This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1 $SYM/' | |
} | |
BLUE="\[\e[1;34m\]" | |
BLUE_="\[\e[0;34m\]" | |
BROWN_="\[\e[0;33m\]" | |
RESET="\[\e[0;0m\]" | |
SYM="$BLUE_Δ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveSupport::BufferedLogger | |
def add(severity, message = nil, progname = nil, &block) | |
return if @level > severity | |
message = (message || (block && block.call) || progname).to_s | |
# If a newline is necessary then create a new message ending with a newline. | |
# Ensures that the original message is not mutated. | |
message = "#{message}\n" unless message[-1] == ?\n | |
buffer << message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show Term::ANSIColor effects | |
(Term::ANSIColor.methods - Module.methods).sort.each{|x| print "#{x}: ".ljust(15); begin; puts Term::ANSIColor.send(x, 'foo bar'); rescue; puts 'error'; end } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
@irb_extensions = [] | |
def require_for_irb_with_fallback_for_bundler_constraints(gem_name, load_file = nil) | |
load_file ||= gem_name | |
begin | |
begin | |
require load_file | |
rescue LoadError => e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
@@caller_counter = {} | |
def include_with_caller?(value) | |
key = caller[0,4].join('|') | |
@@caller_counter[key] = (@@caller_counter[key] || 0) + 1 | |
include_without_caller?(value) | |
end | |
alias_method_chain :include?, :caller | |
def self.callers | |
@@caller_counter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 7878ed28ba6bafbe4f90286f4b86ab35e223939e Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Fri, 5 Nov 2010 19:10:37 +0100 | |
Subject: [PATCH] Added config option #order | |
--- | |
lib/looksee.rb | 21 ++++++++++++++++++++- | |
spec/looksee_spec.rb | 10 ++++++++++ | |
2 files changed, 30 insertions(+), 1 deletions(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# one line version: | |
# t = Time.new; puts (65.upto(90).map{|i|s = "%%#{i.chr}: %#{i.chr}"; t.strftime(s).ljust(25) + t.strftime(s.downcase)}.join("\n")) | |
# Output: | |
# | |
# %A: Tuesday %a: Tue | |
# %B: September %b: Sep | |
# %C: 20 %c: Tue Sep 21 08:53:35 2010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d775b59b47c284fe43086772cffe7481b951d36a Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Thu, 22 Jul 2010 08:21:35 +0200 | |
Subject: [PATCH] Added tests for start/stop log messages | |
--- | |
test/daemon_spawn_test.rb | 14 ++++++++++++++ | |
1 files changed, 14 insertions(+), 0 deletions(-) | |
diff --git a/test/daemon_spawn_test.rb b/test/daemon_spawn_test.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e35a6eaef85051163204a1ba5c7fa4facdad6420 Mon Sep 17 00:00:00 2001 | |
From: Christoph Petschnig <[email protected]> | |
Date: Wed, 21 Jul 2010 09:52:27 +0200 | |
Subject: [PATCH 1/2] Added 'rake test' | |
--- | |
Rakefile | 7 +++++++ | |
1 files changed, 7 insertions(+), 0 deletions(-) | |
diff --git a/Rakefile b/Rakefile |