Skip to content

Instantly share code, notes, and snippets.

View zwacky's full-sized avatar

Simon zwacky

View GitHub Profile
@zwacky
zwacky / better-git-log.sh
Created March 4, 2014 10:15
Beautified and better git log history output
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
# usage: git lg
@zwacky
zwacky / bash-custom-prompt.sh
Created March 1, 2014 14:01
beautified bash custom prompt
# add to ~/.bashrc
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: '
@zwacky
zwacky / viewport.tmpl.html
Created July 17, 2013 07:43
viewport setup to correctly handle orientation changes on mobile devices, also disabling scaling/pinching
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@zwacky
zwacky / create-git-repo.sh
Created June 7, 2013 08:01
creates a bare git repository with two branches (master, develop) in it, ready to be commited onto.
#!/bin/bash
# shell script to create git repositories
if [ $# -ne 1 ] ; then
echo "usage: create-git REPONAME"
echo "=> example: create-git myrepo"
exit
fi
cd ~/git
@zwacky
zwacky / implode_assoc_array.php
Created June 6, 2013 09:23
implode() an associative array
implode(', ', array_map(
function ($k, $v) { return "{$k}: {$v}"; },
array_keys($array),
array_values($array)
));