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 / 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) {
@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 / .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 / .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 / 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 / progress_with_names.rb
Created November 16, 2011 17:39 — forked from natritmeyer/progress_with_names.rb
An rspec formatter that prints each test name and result to the console on a new line - hudson likes it
require "rspec/core/formatters/base_text_formatter"
class ProgressWithNames < RSpec::Core::Formatters::BaseTextFormatter
def example_passed(example)
super(example)
output.print green(".")
end
def example_pending(example)
super(example)
@nuc
nuc / gist:1834765
Created February 15, 2012 09:33 — forked from technogoat/gist:1528381
Git: Delete a batch of remote tags
$ git ls-remote --tags origin | awk '/^(.*)(\s+)(.*[a-z0-9])$/ {print ":" }' | xargs git push origin
@nuc
nuc / gist:2204911
Created March 26, 2012 13:05
capybara_webkit wait until ajax completion
wait_until do
page.evaluate_script('$.active') == 0
end
@nuc
nuc / hack.sh
Created March 31, 2012 14:36 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@nuc
nuc / randomthumbs.rb
Created April 22, 2012 08:34 — forked from psobot/randomthumbs.rb
Random Image Thumbnailer
# Hacky random image thumbnailer.
# by Peter Sobot, April 21, 2012
# Based heavily on code by Michael Macias
# (https://gist.github.com/a54cd41137b678935c91)
require 'rmagick'
images = Dir.glob(ARGV[0] ? ARGV[0]
: '-default-input-paths-')
output_dir = (ARGV[1] ? ARGV[1]