Skip to content

Instantly share code, notes, and snippets.

getting things done 💪🏻

Stefan Natter natterstefan

getting things done 💪🏻
View GitHub Profile

Pure ESM package

The package linked to from 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.
azlen / bulletpaths.js
Last active Aug 14, 2022
All Paths Lead to Roam
View bulletpaths.js
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at:
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
View showFirstCellInGoogleSheetAsiOSWidget.js
// Modified from @mutsuda's
// by @levelsio
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = ""
// 4) Install Scriptable @
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
ottsch / add_favicons.js
Last active Jul 16, 2022
Add favicon to links in Roam Research
View add_favicons.js
new MutationObserver(() => {
let filtered =
document.querySelectorAll(".roam-body a"),
(a) => {
return a.hostname && !a.hostname.includes("");
);, (a) => {
if (a.text == "*") { = `url(${a.hostname}) right center no-repeat`;
lukasender /
Created Feb 18, 2020
macOS Catalina: Kill Audio Service "coreaudiod"
function killSound() {
# log coreaudiod process stats
ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$'
# grab the coreaudiod pid, and kill it.
sudo kill -9 $(ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$' | awk '{print $2}')
# wait until restarted
sleep 5
# log coreaudiod process stats again: verify process ID has changed
levelsio / getRandomFollower.php
Created Jan 11, 2020
get random Twitter follower from your exported followers.js
View getRandomFollower.php
// str_replace removes the JS part and makes it into a normal JSON file
$followers=json_decode(str_replace('window.YTD.follower.part0 = ','',file_get_contents(__DIR__.'/followers.js')),true);
echo "\n\n";
echo number_format(count($followers)).' followers';
echo "\n\n";
danielmconrad /
Last active Jul 10, 2022
Installing Unifi Controller + Pi-hole on a Raspberry Pi

Installing Unifi Controller + Pi-hole

Update Packages

sudo rpi-update
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove && sudo apt-get autoclean
sudo apt-get install vim -y
rstacruz /
Last active Feb 13, 2022
Setting up Babel and TypeScript

Install Babel 7 and TypeScript

yarn add --dev \
  @babel/core \
  @babel/cli \
  @babel/preset-env \
  @babel/preset-typescript \
d4rekanguok / webpack.config.js
Last active Feb 13, 2020
Config Storybook to avoid conflicts with SVGR
View webpack.config.js
const path = require('path');
const pathToInlineSvg = path.resolve(__dirname, '../resources/icons');
module.exports = (_, _, defaultConfig) => {
const rules = defaultConfig.module.rules;
// modify storybook's file-loader rule to avoid conflicts with svgr
const fileLoaderRule = rules.find(rule => rule.test.test('.svg'));
fileLoaderRule.exclude = pathToInlineSvg;
ademilter / .storybook
Last active Sep 7, 2021
postcss config for storybook
View .storybook
- webpack.config.js
- postcss.config.js
- config.js
- addons.js