Skip to content

Instantly share code, notes, and snippets.

@padolsey
padolsey / friday.js
Created August 16, 2013 09:26
Utilities for Friday
function isItFriday() {
return new Date().getDay() === 5 ?
'It is!' :
'It is not.';
}
function whenWillItBeFriday() {
var d = 5 - new Date().getDay();
return d === 0 ?
'Right now!' :
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@vedantk
vedantk / README
Created October 24, 2012 23:37
Command line workshop notes
man
* man grep
* apropos uname
if, then, else, fi
* -e (file exists)
* -d (file is directory)
* -z (string is empty)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: