Skip to content

Instantly share code, notes, and snippets.

View glsignal's full-sized avatar

Greg Signal glsignal

  • fairbreeze village
View GitHub Profile
@glsignal
glsignal / unfollow.js
Last active November 10, 2024 15:54
twitter-unfollow.js
function asyncSleep(timeout) {
return new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, timeout + Math.random() * 300 /* jitter */);
});
}
async function removeFollows() {
console.log("Looking for targets");
@glsignal
glsignal / assets.sh
Last active September 8, 2015 01:22
Organise into Android asset folders from sketch exports
# Tweaked from the snipped linked to in https://medium.com/@lmindler/using-sketch-3-and-a-bit-of-fairy-dust-for-a-better-android-workflow-f667d0048855
# Edit the array of densities below depending on what you export.
# Just add in the qualifier (i.e. 'm' for mdpi) - the dpi is
# added automatically
for density in {l,m,h,xh,xxh,xxxh}dpi; do
mkdir drawable-$density
for file in `find . -type f -iname "*-$density*"`; do
mv "$file" "drawable-$density/${file/-$density/}"
done
done

Keybase proof

I hereby claim:

  • I am glsignal on github.
  • I am glsignal (https://keybase.io/glsignal) on keybase.
  • I have a public key whose fingerprint is 7859 5B92 BDDB B592 D883 C243 2DAA 0884 BE89 5380

To claim this, I am signing this object:

@glsignal
glsignal / gist:6604923
Created September 18, 2013 05:30
Download a snapshot of all Postgres instances associated with your Heroku apps, installing the pgbackups in the process.
heroku apps | sed -e "s/^===.*$//" | sed "/^$/d" | cut -d " " -f 1 | while read f; do echo $f && heroku addons:add pgbackups --app $f ; heroku pgbackups:capture --app $f && curl -o "${f} $(date).pgbackup" $(heroku pgbackups:url --app $f); done
@glsignal
glsignal / gist:3398796
Last active October 8, 2015 22:37
Start a Python http server in the present directory
python=$(which python)
if [ -n "$python" ]; then
python_major=$(python -V 2>&1 | cut -d " " -f 2 | cut -d "." -f 1)
if [ $python_major -lt 3 ]; then
alias webme='python -m SimpleHTTPServer'
else
alias webme='python -m http.server'
fi
fi