Skip to content

Instantly share code, notes, and snippets.

View jdg's full-sized avatar

Jonathan George jdg

View GitHub Profile
@brock
brock / nodereinstall.sh
Last active May 13, 2024 03:24
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
@ignasi
ignasi / resizer-xxhdpi.sh
Last active February 7, 2021 15:29
Android XXHDPI Resizer (Tested on OS X Mavericks)
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do
@nhance
nhance / method_logger.rb
Created September 6, 2012 12:58
Rails compatible method logging. Use this to log all calls to instance methods of a class to the log.
Model.new.foo
@jdg
jdg / gist:476028
Created July 14, 2010 20:36
include git revision number in info.plist
#!/bin/bash
# Include commit rev script by @bsneed
buildPlist="${PRODUCT_NAME}-Info.plist"
buildCommit=$(/usr/local/git/bin/git --work-tree="${PROJECT_DIR}" show --abbrev-commit | grep "^commit")
/usr/libexec/PlistBuddy -c "Add :CFBundleCommit string $buildCommit" $buildPlist
if [ $? != 0 ]
then
/usr/libexec/PlistBuddy -c "Set :CFBundleCommit $buildCommit" $buildPlist
fi