Skip to content

Instantly share code, notes, and snippets.

View snoopdouglas's full-sized avatar

snoopdouglas

View GitHub Profile
@snoopdouglas
snoopdouglas / gist:971a07fb0c3f7c8ce2e937356a9f3ec6
Created February 10, 2023 18:36
rustup build failure (OOM)
$ nix-shell -p rustup
this derivation will be built:
/nix/store/akk9d52ainbdvd8x9v9l34csl1hr8ilz-rustup-1.25.1.drv
building '/nix/store/akk9d52ainbdvd8x9v9l34csl1hr8ilz-rustup-1.25.1.drv'...
unpacking sources
unpacking source archive /nix/store/aba6g2cy03bs08i6np6kpj0y4dygya77-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/ajl6f5p85qmp396m9nndmpm7dbhli2nm-rustup-1.25.1-vendor.tar.gz
@snoopdouglas
snoopdouglas / push-state-static.js
Created September 18, 2018 16:38
Tiny Barba.js-esque push-state static page transitioner
// "wait for ready or just run immediately" function
import ready from 'ready'
// https://stackoverflow.com/a/21210643
import queryMap from 'query-map'
const transitionQueryParam = '__dynamic'
ready(() => {
if(queryMap[transitionQueryParam] === '1')
return
@snoopdouglas
snoopdouglas / crowdfire-oneliner.js
Last active July 25, 2017 16:27
Remove CrowdFire tweets from your stream (need to make a Chrome plugin out of this…)
(()=>{var a=document.querySelectorAll('.stream-item');for(var b=0;b<a.length;b++){var c=a[b];if(c.children[0]&&c.children[0].classList.contains('js-original-tweet')){var h=c.querySelector('.tweet-text').innerText,j=h.match(/ via @[a-z0-9_]+( #[a-z0-9_])*$/i);j&&(c.style.display='none')}}})();
@snoopdouglas
snoopdouglas / refresh-tunes.sh
Created September 27, 2016 11:46
Copy random songs to an MP3 player until it's full
#!/bin/bash
# NOTE you need coreutils for this - `brew install coreutils`
MUSIC_DIR="/Volumes/Shared/iTunes/iTunes Media/Music"
COPY_TO_DIR="/Volumes/LABEOUF/MUSIC"
echo "this will erase everything in '$COPY_TO_DIR'."
while true; do
read -p "ok? [y/N] " yn
@snoopdouglas
snoopdouglas / canvas-with-data.html
Last active August 2, 2016 08:03
Render entire page using 2D canvas while keeping data visible to crawlers/screen readers
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" rel="stylesheet">
<link href="/z1.css" rel="stylesheet">
<title>Canvas</title>
</head>
<body>
@snoopdouglas
snoopdouglas / ufw-delete-all.sh
Last active July 22, 2016 15:21
One-liner to delete all ufw rules without disabling or reloading the firewall
for j in $(for i in $(sudo ufw status numbered | (grep -E '[0-9]+/(tc|ud)p' |awk -F"[][]" '{print $2}') ) ; do echo $i ; done | tac) ; do sudo ufw --force delete $j ; done