Skip to content

Instantly share code, notes, and snippets.

@jhob
jhob / nish.sh
Created August 6, 2018 20:56
nish.sh
# inspired by https://gist.github.com/assaf/ee377a186371e2e269a7
# requires [n](https://github.com/tj/n) and [jq](https://stedolan.github.io/jq/)
# Install nodejs version specified in package.json via n, otherwise use a blessed version
#
# Exit code:
# 0 Successfully installed and using the desired version
# 1 No package.json in current directory
#
# See debug messages by setting DEBUG=nish in your environment
@jhob
jhob / decision-tree.json
Last active December 5, 2016 18:04
Example decision tree for recommending homepage module
{
"decisionTree": {
"test": {"foodInterests": "gluten-free"},
"children": {
"true": {
"test": {"foodInterests": "paleo"},
"children": {
"true" : {
"test": {"orderCount": 0},
"children": {
@jhob
jhob / keybase.md
Created November 18, 2016 19:40
Keybase

Keybase proof

I hereby claim:

  • I am jhob on github.
  • I am jhob (https://keybase.io/jhob) on keybase.
  • I have a public key ASDlLovDL8vG9MXlGOCgc5h1CjFJetV0gWcTYioGvqv39wo

To claim this, I am signing this object:

@jhob
jhob / lyrics
Created June 24, 2012 23:04 — forked from febuiles/lyrics.sh
Adds Rdio and Spotify support
#!/bin/bash
services=(iTunes Rdio Spotify)
for service in "${services[@]}"; do
if ps axco pid,command | grep -v grep | egrep "$service\$" > /dev/null; then
state=`osascript -e "tell application \"$service\" to get player state as string"`
if [ "$state" = "playing" ] ; then
artist_name=`osascript -e"tell application \"$service\" to get artist of current track"`
song_title=`osascript -e"tell application \"$service\" to get name of current track"`
artist=`echo $artist_name | sed "s/[[:space:]]/%20/g"`