Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@mislav
mislav / .rspactor
Created March 17, 2009 13:12
RSpec colorized unicode output with Rspactor integration
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
RSpactor::Runner.class_eval do
alias old_formatter_opts formatter_opts
def formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end
end
@jcf
jcf / rvm-iconv.rb
Created January 11, 2010 15:42
The full ruby 1.9.1 iconv fix
RUBY_VERSION='1.9.2'
rvm package install iconv
rvm remove $RUBY_VERSION
rvm install $RUBY_VERSION -C --with-iconv-dir=$HOME/.rvm/usr
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@jcf
jcf / development.rb
Created July 28, 2010 11:42
Keep your javascripts in app/javascripts. Read and serve in development and package before deployment
# In config/environments/development.rb
config.middleware.use 'DevelopmentJavascript'
@jcf
jcf / last-rails-migration.sh
Created October 8, 2010 08:28
Get the version of the last staged migration in db/migrate
git ls-files --stage -- db/migrate | xargs -I x basename x | awk ' END { split($1, a, "_"); print a[1] } '
@shes-a-skeeze
shes-a-skeeze / .stumpwmrc
Created December 1, 2011 20:01
stumpwm
;; MY STUMPWM
(in-package :stumpwm)
(setq *mouse-focus-policy* :click)
(setf *startup-message*
"everything seems to be just fine")
(set-contrib-dir "/home/sleeze/.config/stumpwm/contrib")
(setf *suppress-frame-indicator* t)
;; Directories
@cqpx
cqpx / .Xdefaults
Created December 6, 2011 03:33
urxvt xterm zenburn theme
URxvt*termName: rxvt-256color
URxvt*xftAntialias: true
URxvt*background: #3f3f3f
URxvt*foreground: #dcdccc
URxvt*cursorColor: #aaaaaa
URxvt*colorUL: #366060
URxvt*underlineColor: #dfaf8f
URxvt*color0: #3f3f3f
URxvt*color1: #cc9393
URxvt*color2: #7f9f7f
@blacktaxi
blacktaxi / ruby-fmt.clj
Created January 25, 2012 14:42
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@jcf
jcf / bootstrap.sh
Created April 3, 2012 16:17
Bootstrap a Ruby app that uses Bundler
#!/bin/bash
echo "Checking for Ruby..."
type -P ruby &>/dev/null || { echo >&2 "Ruby not found in PATH. Exiting."; exit 1; }
echo "Checking for Bundler..."
gem which bundler &>/dev/null || gem install bundler
echo "Installing gem dependencies..."
bundle install
@joshuap
joshuap / deploy.rb
Created October 7, 2012 01:19
Honeybadger deployment notification capistrano task using local machine and curl
namespace :deploy do
desc "Notifies Honeybadger locally using curl"
task :notify_honeybadger do
require 'json'
require 'honeybadger'
begin
require './config/initializers/honeybadger'
rescue LoadError
logger.info 'Honeybadger initializer not found'