Skip to content

Instantly share code, notes, and snippets.

View NickStemerdink's full-sized avatar

Nick Stemerdink NickStemerdink

View GitHub Profile
@NickStemerdink
NickStemerdink / gist:6136215
Created August 1, 2013 23:18
sed camel case to underscore
Command: sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g'
$ echo foo | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g'
$ echo Foo | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g'
$ echo SuperFooBar | sed -e 's/\([A-Z]\)/_\l\1/g' -e 's/^_\([a-z]\)/\1/g'
@NickStemerdink
NickStemerdink / gist:6129954
Created August 1, 2013 09:43
Run composer.phar with the specified php binary
php53 `which composer.phar`
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@caruccio
caruccio / bash-named-param
Created April 24, 2012 03:25
Named parameters in bash
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc bar=world foo=hello
foo=hello, bar=world