Skip to content

Instantly share code, notes, and snippets.

@thenoseman
thenoseman / gist:1173309
Created August 26, 2011 12:34 — forked from thomasjachmann/gist:1173001
restore lost git commits
#!/usr/bin/env ruby
# Helps recovering lost commits, eg when you've:
# - dropped a stash
# - reset a branch to an earlier commit, dropping the changes with --hard
#
# Shows which files have been changed in which dangling commit and prints
# the commands to view details of and restore a commit.
#
# When given a parameter, only lists commits that changed a file matching
@thenoseman
thenoseman / jsonval.sh
Created July 5, 2011 12:00 — forked from cjus/jsonval.sh
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

gem install thor rest-client

Use it as such: