Skip to content

Instantly share code, notes, and snippets.

@coldclimate
coldclimate / gist:5968918
Created July 10, 2013 18:38
Cheese scale. 1 (rubbish) to 10 (perfect)
1 Cheez Whiz
2 Dairylea
3 French Brie
4 Edam
5 Mild Cheddar
6 Smoked Applewood
7 Summerset Brie
8 Mature Cheddar
9 St James
10 Stilton
@coldclimate
coldclimate / gist:5926630
Last active December 19, 2015 08:38
Find the commit on Master that was HEAD when branch FEATURE was branched (I'm not 100% on this wizardry) (found in http://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git)
diff -u <(git rev-list --first-parent FEATURE) \
<(git rev-list --first-parent master) | \
sed -ne 's/^ //p' | head -1
@coldclimate
coldclimate / gist:5926209
Created July 4, 2013 09:20
What is in branch A that is not in Branch B made pretty
git log --pretty=oneline --abbrev-commit --decorate B..A
@coldclimate
coldclimate / gist:5875670
Created June 27, 2013 11:10
Which processes are listening on which ports (readable version)
sudo netstat -lntp
@coldclimate
coldclimate / gist:5857788
Created June 25, 2013 11:31
Find which repo each of your PRs was destined for using GitHubAPI + JQ
for i in `seq 1 170`; do RESULT=`curl -s -u username:password "https://api.github.com/repos/owner/repo/pulls/${i}" | jq '.base | {ref}'| grep ref`; echo "${i}:${RESULT}";done
@coldclimate
coldclimate / gist:5857746
Created June 25, 2013 11:23
get all commits for a pull request using jq
curl -s -u coldclimate "https://api.github.com/repos/canddi/canddi/pulls/114/commits" | jq '.[] | {sha}'
@coldclimate
coldclimate / gist:5186432
Created March 18, 2013 10:58
A one liners to strip all the crap from php.ini so you can diff it easily when you upgrade
cat php.ini.ucf-old | sed '/^;/ d' | sed '/^\[/ d' | sed '/^$/d' | sort > php.old
@coldclimate
coldclimate / gist:5109395
Created March 7, 2013 16:35
http://YOURGRAPHITESERVER/render?tz=GMT&width=600&from=-24hours&until=now&height=400&lineMode=staircase&target=XXXXXXXXXXX
USEFUL GRAPHS TO GO
@coldclimate
coldclimate / gist:4510073
Created January 11, 2013 11:33
Show what's using disk in this directory, biggest first
du -sch * | sort -h -r
@coldclimate
coldclimate / gist:3169629
Created July 24, 2012 12:18
Copy objects from from Mongodb db.collection to another
Dirty and not safe but ok for ditry stuff.
db.CollectionOne.find().forEach(function(d){ db.getSiblingDB('ther-db').CollectionTwo.insert(d); });