Skip to content

Instantly share code, notes, and snippets.

View nuc's full-sized avatar
🍱
Always Hungry

Georgios Giannoutsos Barkas nuc

🍱
Always Hungry
View GitHub Profile
@nuc
nuc / Find file in git and restore.txt
Created November 15, 2011 09:19
Checkout deleted file from git repository
git log --diff-filter=D --summary
git checkout [commit_hash]^ deleted_file.txt
@nuc
nuc / .gitconfig
Created November 15, 2011 09:06
Git History (tree log with pretty format)
[alias]
log --pretty=format:\"%h %ad | %s%Cgreen%d%Creset [%Cblue%an%Creset]\" --graph --date=short --topo-order
@nuc
nuc / .git-completion.sh
Created September 26, 2011 13:50
bash completion support for core Git.
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@nuc
nuc / .profile
Created September 21, 2011 09:47
Colorized git status in bash prompt
RED=`echo -e '\033[01;31m'`
BLUE=`echo -e '\033[01;34m'`
GREEN=`echo -e '\033[01;32m'`
NORMAL=`echo -e '\033[00m'`
function is_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]]
}
function parse_git_branch {
if is_git_dirty
@nuc
nuc / gist:1229418
Created September 20, 2011 15:31 — forked from jnx/gist:1229355
Node.js Campfire bot
// main app.js
var client = require('ranger').createClient('ROOM',
'SECRET');
var timestamp = require('./timestamp').timestamp;
var getWeatherWrapper = require('./weather').getWeatherWrapper;
var showMap = require('./map').showMap;
var getTweets = require('./tweets').getTweets;
client.room(ROOMID, function(room) {