Skip to content

Instantly share code, notes, and snippets.

@kbrandwijk
kbrandwijk / notifier.js
Created August 18, 2021 06:45
Autocode Expo Slack Notifier
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const {createHmac} = await import('crypto');
const safeCompare = require('safe-compare');
// Expo request signature check
const hmac = createHmac('sha1', process.env.SECRET_WEBHOOK_KEY);
hmac.update(Buffer.from(JSON.stringify(context.params)));
const hash = `sha1=${hmac.digest('hex')}`;
console.log('context.params', context.params)
@bradfitz
bradfitz / ws.go
Created November 5, 2018 17:06
pre-Go1.12 websocket hijack+proxy
httpsServer := &http.Server{
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
hj, isHJ := w.(http.Hijacker)
if r.Header.Get("Upgrade") == "websocket" && isHJ {
c, br, err := hj.Hijack()
if err != nil {
log.Printf("websocket websocket hijack: %v", err)
http.Error(w, err.Error(), 500)
return
}
@Shujito
Shujito / spotihosts
Last active November 29, 2023 06:56
The hosts file entries to block Spotify audio ad servers.
# taken from here:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
0.0.0.0 adclick.g.doublecklick.net
0.0.0.0 adeventtracker.spotify.com
0.0.0.0 ads-fa.spotify.com
0.0.0.0 analytics.spotify.com
0.0.0.0 audio2.spotify.com
0.0.0.0 b.scorecardresearch.com
0.0.0.0 bounceexchange.com
0.0.0.0 bs.serving-sys.com
@mdo
mdo / 00-intro.md
Last active June 25, 2024 18:16
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@sweeneyrobb
sweeneyrobb / install-jekyll-prerequisites.ps1
Last active June 28, 2018 00:23
This PowerShell script will install and configure all the pre-requisites for Jekyll. There is commented code to initalize a Jekyll directory. Simply change directory to desired folder, uncomment script, and execute.
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install ruby -y
choco install ruby2.devkit -y
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine")
$env:Path += ";$env:ChocolateyBinRoot\ruby23\bin"
cd "$($env:ChocolateyInstall)\helpers\functions"