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
module R18n | |
class Translation | |
def iterate(s) | |
root = self | |
s.split('.').each { |key| root = root[key] } | |
root | |
end | |
end | |
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
# | |
# Get SCSS working in Sinatra | |
# | |
configure do | |
Tilt.register 'scss', Tilt::SassTemplate | |
set :sass, Compass.sass_options.merge({:syntax => :scss}) | |
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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
export PS1="\[\e[0;37m\][\[\e[0;31m\]\u\[\e[1;37m\]@\[\e[0;32m\]\h\[\e[0;37m\]] \[\e[1;37m\]\w\$(parse_git_branch) \$ \[\e[0;37m\]" | |
[[ "${TERM}" == "screen" ]] && echo -n -e '\ek'${HOSTNAME%%.*}'\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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
# Install Local Terminal (Incubation) from the Helios Marketplace | |
# then set an Env variable for your shell for IS_ECLIPSE=yes | |
# and be sure to do /bin/bash -l, too | |
if [ "$IS_ECLIPSE" == "yes" ]; then |
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 'open3' | |
require 'rainbow' | |
require 'fileutils' | |
static_dir = 'static' | |
def growl(title, message) | |
system %{growlnotify -m "#{message}" "#{title}"} | |
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
def growl(title, message) | |
system %{growlnotify -m "#{message}" "#{title}"} | |
end | |
def reek(file) | |
output = %x{reek #{file}} | |
puts output | |
file, warnings = output.split("\n").first.split(" -- ") |
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
Index: colorer/src/zlib/contrib/minizip/ioapi.c | |
=================================================================== | |
--- colorer/src/zlib/contrib/minizip/ioapi.c (revision 1626) | |
+++ colorer/src/zlib/contrib/minizip/ioapi.c (working copy) | |
@@ -1,3 +1,7 @@ | |
+#define fopen64 fopen | |
+#define fseeko64 fseeko | |
+#define ftello64 ftello | |
+ | |
/* ioapi.h -- IO base function header for compress/uncompress .zip |
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
def rcov(file = nil) | |
file = Dir['spec/**/*_spec.rb'].join(' ') if !file | |
system %{bundle exec ruby -Ilib -S rcov -x '/gems/,config/,spec/' -t $(which rspec) -- #{file}} | |
end | |
watch('app/(.*/.*)\.rb') { |m| rcov("spec/#{m[1]}_spec.rb") } | |
watch('spec/(.*/.*)_spec\.rb') { |m| rcov(m[0]) } | |
rcov |
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 'net/http' | |
require 'mechanize' | |
class RemoteSiteWatchr | |
def initialize(host, urls, &block) | |
@host = host | |
@urls = urls | |
@block = block | |
@agent = Mechanize.new |
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
# Actually .autotest and lives at the root of your project, from where you execute autotest | |
# this is all done in a hook, like this: | |
Autotest.add_hook :initialize do |at| | |
# i don't like the default exceptions, get rid of them! | |
at.clear_exceptions | |
# exclude stuff that changes between each test, like log | |
at.add_exception('log/') |
OlderNewer