Skip to content

Instantly share code, notes, and snippets.

View zakgrant's full-sized avatar
🎯
Focusing

Zak Grant zakgrant

🎯
Focusing
View GitHub Profile
@zakgrant
zakgrant / gist:2424699
Created April 19, 2012 22:41
How to gwt ruby-debug and ruby-debug-ide up and running
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/74596/ruby_core_source-0.1.5.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
wget http://rubygems.org/downloads/ruby-debug-ide-0.4.17.beta8.gem
wget http://rubyforge.org/frs/download.php/64707/ruby-debug-ide19-0.4.12.gem
export RVM_SRC=~/.rvm/src/ruby-1.9.3-p0
gem install linecache19-0.5.13.gem -- --with-ruby-include=$RVM_SRC
@zakgrant
zakgrant / gist:2375494
Created April 13, 2012 09:55
ERB to HAML
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
`rm -Rf #{file}`
end
@zakgrant
zakgrant / module_chaining.rb
Created April 3, 2012 20:08
Example of chaining module instance methods
#! /usr/bin/env ruby
module A
def say_hello name
puts "Hello #{name}"
end
end
class B
include A
@zakgrant
zakgrant / person.rb
Created March 10, 2012 15:44
Alias'd Instantiation
class Person
attr_accessor :first_name, :surname
@first_name = 'zak'
@surname = 'grant'
class << self
def new(options={})
Person.new options
end
@zakgrant
zakgrant / Car.java
Created January 13, 2012 11:13
Junit - Validating exception thrown WIP
public class Car {
}