Skip to content

Instantly share code, notes, and snippets.

View nielthiart's full-sized avatar

Niel Thiart nielthiart

View GitHub Profile
@surprisetalk
surprisetalk / hn-gpt-free.js
Created March 23, 2023 13:00
Userscript to hide any HackerNews story with "GPT" in its title.
// ==UserScript==
// @name HackerNews GPT-Free Feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides any Hacker News story with "GPT" in its title.
// @author Taylor Troesh
// @include https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
@sindresorhus
sindresorhus / esm-package.md
Last active May 11, 2024 07:48
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.
@savetheclocktower
savetheclocktower / README.md
Last active May 5, 2024 19:44
Using a rotary encoder as a volume control for the Raspberry Pi

Using a rotary encoder as a volume control

On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.

Rotary encoder

A rotary encoder is like the standard potentiometer (i.e., analog volume knob) we all know, except (a) you can keep turning it in either direction for as long as you want, and thus (b) it talks to the RPi differently than a potentiometer would.

I picked up this one from Adafruit, but there are plenty others available. This rotary encoder also lets you push the knob in and treats that like a button press, so I figured that would be useful for toggling mute on and off.

@bendyorke
bendyorke / setup.md
Last active March 12, 2021 14:25
Setting up a new mac
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@cjolly
cjolly / pg.sh
Last active July 25, 2022 20:16
Use homebrew to upgrade to postgres on OSX
newpg=9.6.1 # set to new PG version number
oldpg=`pg_config --version | cut -d' ' -f2`
# PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build.
# I *think* this should prevent it from installing v7. But if weird shit happens with various rubies,
# you'll have to reinstall them.
brew pin readline
# Stop current Postgres server
brew services stop postgresql