bluwy’s gists · GitHub
Skip to content Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Instantly share code, notes, and snippets. ♥️ 【=◈︿◈=】 Bjorn Lu bluwy ♥️ 【=◈︿◈=】 Building tools for fun. @vitejs core team member.
1.7k followers · 40 following Kuching, Sarawak, Malaysia 19:08 (UTC +08:00) https://bjornlu.com @bluwy.me @bluwyoo @bluwy@m.webtoo.ls View GitHub Profile Recently created Least recently created Recently updated Least recently updated 1 file 0 forks 0 comments 0 stars bluwy / clear-safari-history.js Last active January 9, 2026 05:58 Script to clear Safari history older than N days (and deletes other unnecessary data) import fs from 'node:fs' import path from 'node:path' import { DatabaseSync } from 'node:sqlite' /* How to run?
1. Copy from ~/Library/Safari/History.db to current directory 2. Run: node clear-safari-history.js (Node.js v24 required) 3. Paste the updated History.db back to ~/Library/Safari/History.db (backup the original file if needed) 1 file 0 forks 0 comments 0 stars bluwy / Refined GitHub Copilot UI.user.js Created October 29, 2025 08:00 // ==UserScript== // @name Refined GitHub Copilot UI // @license MIT // @version 0.0.1 // @description Remove clutter in the GitHub Copilot UI // @author Bjorn Lu // @match https://github.com/** // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com // @grant none // ==/UserScript== 3 files 0 forks 0 comments 0 stars bluwy / _readme.md Last active January 3, 2025 11:36 Benchmark the time spent on transferring data in child process Copy the file s and run node main.js .
There's some numbers you can tweak at the top of the file imitating a project with some modules and average module file size. It may take a while to run. Line 29 shows the time a took between a stdin write and stdout read for each request made. 2 files 0 forks 0 comments 0 stars bluwy / _results Last active January 1, 2025 14:51 Performance between using node Buffer vs ArrayBuffer to parse tar files ┌─────────┬──────────────────────┬──────────────────────┬─────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐ │ (index) │ Task name │ Latency average (ns) │ Latency median (ns) │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │ ├─────────┼──────────────────────┼──────────────────────┼─────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤ │ 0 │ 'buffer' │ '53789.86 ± 0.14%' │ '52708.03' │ '18746 ± 0.06%' │ '18972' │ 37182 │ │ 1 │ 'array buffer' │ '39104.97 ± 0.74%' │ '36292.02' │ '26764 ± 0.08%' │ '27554' │ 51145 │ │ 2 │ 'array buffer extra' │ '37756.63 ± 0.25%' │ '36250.00' │ '27002 ± 0.07%' │ '27586' │ 52971 │ └─────────┴──────────────────────┴──────────────────────┴─────────────────────┴────────────────────────────┴───────────────────────────┴────── 2 files 0 forks 0 comments 0 stars bluwy / _results Last active January 1, 2025 08:44 zlib.gunzip vs DecompressionStream performance benchmark ┌─────────┬───────────────────────────────────────────┬──────────────────────┬─────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐ │ (index) │ Task name │ Latency average (ns) │ Latency median (ns) │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │ ├─────────┼───────────────────────────────────────────┼──────────────────────┼─────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤ │ 0 │ 'zlib gunzip (from node buffer)' │ '1921050.70 ± 3.04%' │ '1751584.05' │ '550 ± 1.31%' │ '571' │ 521 │ │ 1 │ 'DecompressionStream (from array buffer)' │ '2922942.41 ± 4.29%' │ '2149625.00' │ '392 ± 3.36%' │ '465' │ 343 │ │ 2 │ 'DecompressionStream (from stream)' │ '2904491.21 ± 4.31%' │ '2123957.99' │ '395 ± 3.37%' │ '471' │ 345 │ └─────────┴───── 1 file 0 forks 0 comments 2 stars bluwy / GitHub Delete Issues.user.js Last active May 23, 2024 09:32 Userscript to add a delete issue button in the issues page.
It opens the issue in a new tab, delete it, and auto-close the tab (sometimes not working). There's also a button to delete all issues in the current page, which opens all the tabs at once. Also works for discussions. BEWARE that deleting issues is not reversible! // ==UserScript== // @name GitHub Delete Issues // @license MIT // @version 0.1.0 // @description Adds buttons to easily delete issues // @author bluwy // @match https://github.com/** // @grant none // ==/UserScript== 1 file 0 forks 0 comments 0 stars bluwy / publint_analysis.json Last active November 19, 2026 12:27 Results of publint's analysis script (force push only) { "semver@7.8.6": 1, "minimatch@11.0.9": 1, "debug@4.4.3": 1, "ansi-styles@7.0.0": 0, "brace-expansion@5.0.13": 1, "strip-ansi@7.2.0": 0, "ansi-regex@6.6.0": 0, "ms@2.1.3": 1, "supports-color@11.0.0": 0, 1 file 2 forks 0 comments 7 stars bluwy / rollup-optimization-research.md Last active March 6, 2025 10:43 Rollup build optimization research Rollup build optimization research Rollup builds doesn't scale well in large apps.
You need to increase Node's memory with --max-old-space-size=4096 to handle all the modules. This is one of Vite's highest-rated issue . This file documents various findings and attempts to improve this issue. How Rollup works NOTE: I've only been reading Rollup's source code for a while, so some of these may not be accurate. 1 file 0 forks 0 comments 0 stars bluwy / sponsors.svg Last active August 22, 2026 18:06 The sponsor image - https://github.com/bluwy/sponsors Loading Sorry, something went wrong.
Reload? Sorry, we cannot display this file. Sorry, this file is invalid so it cannot be displayed. 3 files 1 fork 2 comments 5 stars bluwy / sequence.js Last active March 29, 2022 03:42 Run Svelte preprocessors in the sequence they are declared import { preprocess } from 'svelte/compiler' /** * @typedef {import("svelte/types/compiler/preprocess").PreprocessorGroup} PreprocessorGroup * @param {PreprocessorGroup[]} preprocessors * @returns {PreprocessorGroup[]} */ export function sequence(preprocessors) { return preprocessors.map((preprocess
The rest of this page is on the live site.