Skip to content

Instantly share code, notes, and snippets.

View roelven's full-sized avatar

Roel van der Ven roelven

View GitHub Profile
@roelven
roelven / gist:814296
Created February 7, 2011 12:15
.gitconfig
[user]
name = Roelven
email = [email protected]
[color]
branch = auto
diff = auto
status = auto
interactive = auto
ui = auto
@roelven
roelven / gist:788106
Created January 20, 2011 16:13
.git config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[color]
ui = auto
[color "branch"]
current = yellow reverse
<meta content="SoundCloud" property="og:site_name" />
<meta content="Sounds by Forss on SoundCloud" property="og:title" />
<meta content="http://i1.soundcloud.com/avatars-000000011308-xq0whu-large.jpg?3e8e24" property="og:image" />
<meta content="Sounds by Forss: Musician &amp;amp; Founder/CTO SoundCloud | Shared via SoundCloud" property="og:description" />
<meta content="video" name="medium" />
<meta content="242" property="og:video:height" />
<meta content="460" property="og:video:width" />
<meta content="application/x-shockwave-flash" property="og:video:type" />
<meta content="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fforss&amp;color=3b5998&amp;auto_play=true&amp;show_artwork=false" property="og:video" />
@roelven
roelven / gist:733491
Created December 8, 2010 16:18
transfer a whole dir from one server to another
## transfer a whole dir from one server to another
##
scp -P 31415 -r /var/www/vhosts/roelvanderven.com/subdomains/dump/httpdocs/* [email protected]:/usr/local/www/dump/
@roelven
roelven / gist:718811
Created November 28, 2010 10:47
Print the sanitized page title as #id in the body tag:
//
// I don't like logic in views / template files.
// Here's a first attempt of nicely identifying your pages by page titles.
//
// Yes, I know Wordpress' body_class() does something similar,
// but I like semantics and readable code.
//
// Put this in your functions.php:
// Print the sanitized page title as #id in the body tag:
@roelven
roelven / gist:711865
Created November 23, 2010 14:47
Install rvm
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
@roelven
roelven / gist:711818
Created November 23, 2010 14:15
My .profile
##
## My .profile file.
## Replace Roel with your own username!
##
export PS1='\u@\h:\w $(vcprompt)\$ '
export PATH=/usr/local/sbin:$PATH
export CDPATH=/Users/Roel/Sites
##
@roelven
roelven / gist:663332
Created November 4, 2010 22:44
Sort amount of results per city in mysql
SELECT `plaats`, count(*) AS `Number`
FROM `kijkmijnhuis`
GROUP BY `plaats`
ORDER BY `Number` DESC
LIMIT 20;
@roelven
roelven / gist:663124
Created November 4, 2010 20:23
Parse .eml files to retrieve emailaddresses
##
## Parse a whole directory of .eml files
## and retrieve all printed emailaddresses, sort them, and remove duplicates
## and print to a file.
##
perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' *.* | sort -u > /tmp/output.txt
@roelven
roelven / gist:660977
Created November 3, 2010 11:13
Awesome git functions to check differentiation between branches
##
## Add awesome git functions to check differentiation between branches.
## Add this to your ~/.profile and reload with $ source ~/.profile
##
## See http://stackoverflow.com/questions/53569/how-to-get-the-changes-on-a-branch-in-git
##
function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}