Skip to content

Instantly share code, notes, and snippets.

@nsfmc
nsfmc / git-music.sh
Last active January 25, 2017 17:54 — forked from mroth/git-music.sh
Adds the currently playing iTunes/Spotify track to your prepared git commit message.
#!/bin/bash
# Adds the currently playing iTunes track to your prepared commit message.
#
# To install, save in repo as chmod +x to .git/hooks/prepare-commit-msg
# save music.js somewhere like ~/.bin
# if you don't use a commit template $SONG should precede $1 to allow --verbose
# commits to work, otherwise change the echo to "$(cat $1)\n\n$SONG"
SONG=`osascript -l JavaScript ~/.bin/music.js`
if [[ $SONG ]]; then
echo -e "\n\n$SONG\n$(cat $1)" > $1
@nsfmc
nsfmc / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block

A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.

@nsfmc
nsfmc / README.md
Last active August 29, 2015 14:06 — forked from mbostock/.block

A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.

// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/