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
#app/grids/addendum_grid.yml | |
--- | |
:grid: | |
:dom_id: "addendums_grid" | |
:caption: "Addendums" | |
:pager_options: | |
:core: | |
:edit: true | |
:search: false | |
:add: true |
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 clause(op, field, data) | |
out = [] | |
out << ops_table[op][:field_proc].call(field) | |
out << ops_table[op][:data_proc].call(data) | |
out | |
end | |
#later | |
model.where(*clause(op, field, data)) |
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 MyModule | |
class MyModuleError < StandardError | |
@@ignore = :warn | |
def ok_to_ignore? | |
@@ignore | |
end | |
def self.ok_to_ignore | |
@@ignore |
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 ColorFormatter < Log4r::Formatter | |
attr_accessor :color, :label, :colors, :format_string | |
def colors | |
@level_colors || [:cyan, :green, :yellow, :light_red, :red] | |
end | |
def initialize(opts={}) | |
@depth = (opts[:depth] || 7 ).to_i | |
@color = opts[:color] || true |
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
#Gemfile | |
group :development do | |
gem 'guard' | |
gem 'guard-bundler' | |
gem 'guard-rspec' | |
gem 'guard-annotate' | |
gem 'guard-spork' | |
#For linux | |
#gem 'rb-inotify' | |
#gem 'libnotify' |
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 mk_rvmrc() { | |
my_ruby=${argv[1]:=$ruby19} #I set ruby19=ruby-1.9.2@p290 elsewhere. | |
my_gemset=${argv[2]:=`basename $PWD`} #uses the name of the current directory if no 2nd arg is given | |
rvm --create --rvmrc ${my_ruby}@${my_gemset} | |
} |
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
guard 'bundler' do | |
watch('Gemfile') | |
end | |
guard 'passenger' do | |
watch(%r{lib/.*\.rb}) | |
watch(%r{config/.*\.rb}) | |
end | |
guard 'livereload' do |
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
gconftool-2 -s /desktop/gnome/url-handlers/txmt/command '/usr/local/bin/openInMine "%s"' --type String | |
gconftool-2 -s /desktop/gnome/url-handlers/txmt/enabled --type Boolean true |
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 'paper_trail' | |
class EventLog < ActiveRecord::Base | |
#snipped stuff | |
before_create :on_creation | |
before_save :on_save | |
after_save :after_save | |
#snipped stuff | |
def after_save | |
#do stuff |
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
#Anithri preinstall gems | |
#gem install rails -v 3.0.0.beta4 | |
#gem install bundler -v 1.0.0.beta.4 | |
# When ready run as | |
# rails new ArtificalCasting -d mysql -J -m http://gist.github.com/471391.txt | |
puts "=" * 80 | |
puts "Step 1. Remove some unused files and directories" | |
puts "=" * 80 |