Skip to content

Instantly share code, notes, and snippets.

noraj /
Last active September 20, 2023 17:27
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)
ryansolid / framework size
Last active October 22, 2022 13:27
Size Comparison Vue vs Svelte vs Solid
View framework size

Based on Evan You's methodology:


Vue Vue (SSR) Svelte Svelte (SSR) Solid Solid (SSR)
Source 3.93kb - 3.31kb - 4.98kb -
Compiled w/o imports (min) 2.73kb - 5.01kb (183.52%) 6.59kb (241.39%) 3.68kb (134.805) 3.96kb (145.05%)
Compiled w/o imports (min+gz) 1.25kb - 2.13kb (170.40%) 2.68kb (214.40%) 1.46kb (116.80%) 1.57kb (125.60%)
Compiled w/o imports (min+brotli) 1.10kb - 1.88kb (170.91%) 2.33kb (211.82%) 1.26kb (114.55%) 1.32kb (120.00%)
DashBarkHuss / background.js
Created July 20, 2021 22:33
Sample Chrome Extension Message Passing Background to Content Script Manifest V3
View background.js
try {
// This is the background script for the extension
// A listener for when the user clicks on the extension button
// chrome.action.onClicked.addListener(buttonClicked);
// Handle that click
function buttonClicked(tab) {
sindresorhus /
Last active September 27, 2023 05:09
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
mislav / gh-rename-master
Last active April 24, 2022 10:02
Rename the default branch of a repository using GitHub CLI
View gh-rename-master
# Usage: gh-rename-master <newbranch> [<remote>]
# Renames the "master" branch of the current repository both locally and on GitHub.
# dependencies: GitHub CLI v0.10
set -e
View little-vdom.js
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays,p)=>render(e,d,t.o&&t.o[p])):
// components{children:e.c},e.p),e.s=t.s||{},t=>
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props
DavidWells / netlify.toml
Last active July 31, 2023 22:35
All Netlify.toml & yml values
View netlify.toml
ID = "Your_Site_ID"
# Settings in the [build] context are global and are applied to all contexts unless otherwise overridden by more specific contexts.
# This is the directory to change to before starting a build.
base = "project/"
# NOTE: This is where we will look for package.json/.nvmrc/etc, not root.
# This is the directory that you are publishing from (relative to root of your repo)
henfiber /
Last active September 18, 2023 12:44
Buying keyboards and keyboard components from EU


  • SkinFlint : Price comparison site which has some nice filtering options per switch type etc. Searches for offers in UK, Germany, Poland and Austria
  • : Keyboards, keycaps and accessories. Based in Belgium.
  • : European Store selling Vortex, Leopold, KBP, Anne Pro keyboards, keycap sets and components (ISO + ANSI). Based in Germany, ships to EU.
  • : custom wooden bamboo cases, and some acrylic and carbon ones. Switch packs (65 browns at 48EUR). Other parts for the GH60, Atreus, ErgoDox. Also Microcontrollers, diodes, leds etc.
  • - Mostly PCBs, tools and accessories. Located in Czech Republic.
  • KEYGEM : Switches, Keycaps, lubes, cables, DIY kits and deskmats. Based in Germany, ships to the EU and worldwide.
  • [Eloquent Clicks - Custom Mechanical Keyboard Store](https://www.eloquen
zadr / steps.txt
Last active August 10, 2022 19:31
MacPorts install without root privileges
View steps.txt
# fetch MacPorts sources
curl -LO
# extract them and get into the dir
tar -jxf MacPorts-2.4.1.tar.gz
cd MacPorts-2.4.1
# configure things
## If you want MacPorts to run in a custom prefix, pass in the following arguments: --prefix=/usr/local --with-unsupported-prefix --with-applications-dir=/Applications
./configure --with-no-root-privileges --with-install-user=$USER --with-install-group=staff --silent
LeeBergstrand / Linuxbrew_Config.yml
Last active September 29, 2021 09:20
CircleCi config for homebrew
View Linuxbrew_Config.yml
version: 2
working_directory: ~/repo
machine: true
- checkout