Public Gists by joshuaclayton

Gravatar
Fri Jun 19 13:37:22 -0700 2009
1
2
3
--type-add=ruby=.haml,.rake,.rsel,.builder
--type-add=html=.html.erb,.html.haml
--type-add=js=.js.erb
Gravatar
Mon Jun 15 19:12:36 -0700 2009
1
2
3
# Problem 1: 234168
(1..1000).select {|i| i % 3 == 0 || i % 5 == 0}.inject(:+)
 
Gravatar
Thu Jun 11 13:45:50 -0700 2009
1
2
3
  def self.private_attributes(*args)
    @@private_attributes = [args].flatten
    
Gravatar
Mon Jun 08 12:14:36 -0700 2009
1
2
3
    $("form").each(function(idx, form) {
      var onsubmit = $(form).attr("onsubmit");
      
Gravatar
Mon Jun 08 11:47:49 -0700 2009
1
2
3
    $("form").each(function(idx, form) {
      console.log("looping through forms");
      
Gravatar
Thu Apr 30 06:23:28 -0700 2009
1
2
3
gem "thoughtbot-clearance", :version => "0.6.3", :source => "http://gems.github.com", :lib => "clearance"
gem "aslakhellesoy-cucumber", :version => "0.3.0", :source => "http://gems.github.com", :lib => "cucumber"
gem "giraffesoft-resource_controller", :version => "0.6.1", :source => "http://gems.github.com", :lib => "resource_controller"
Gravatar
Tue Apr 28 06:32:02 -0700 2009
1
2
3
source ~/.git-completion.sh
source ~/.bash_colors.sh
 
Gravatar
Wed Apr 22 04:56:11 -0700 2009
1
2
3
DULL=0
BRIGHT=1
 
Gravatar
Wed Apr 15 07:44:43 -0700 2009
1
2
3
When /^I attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field|
  path = File.join(RAILS_ROOT, path)
  
Gravatar
Tue Apr 07 07:40:05 -0700 2009
1
2
3
# Notes: You NEED to type 'y' and then press enter a few seconds into
# generating the clearance features (to overwrite the features/support/paths.rb).
# no prompt shows up by default.
Gravatar
Mon Apr 06 03:52:18 -0700 2009
1
2
3
class FilterableEnumerable
  def initialize(original)
    @original = original
Gravatar
Sun Apr 05 15:00:26 -0700 2009
1
2
3
Tag.class_eval do
  default_scope :joins => :taggings
  named_scope :popular, lambda {{
Gravatar
Sun Apr 05 14:33:53 -0700 2009
1
2
3
named_scope :on, lambda {|klass| {
  :joins => "INNER JOIN #{Tagging.quoted_table_name} ON #{Tagging.quoted_table_name}.tag_id = #{Tag.quoted_table_name}.id " + \
            "INNER JOIN #{klass.quoted_table_name} ON #{klass.quoted_table_name}.id = #{Tagging.quoted_table_name}.taggable_id " + \
Gravatar
Mon Mar 30 07:26:36 -0700 2009
1
2
3
(function($) {
  var dirtyForm = {
    settings: {
Gravatar
Thu Mar 12 11:56:00 -0700 2009
1
2
3
require 'test/unit'
require 'test/unit/ui/console/testrunner'
 
Gravatar
Mon Mar 09 08:34:22 -0700 2009
1
2
3
scope = LoggedException
scope = scope.search(params[:query]) unless params[:query].blank?
scope = scope.days_old(params[:date_ranges_filter]) unless params[:date_ranges_filter].blank?
Gravatar
Sun Mar 08 19:45:02 -0700 2009
1
2
3
base.send :include, AASM
base.aasm_column :status
 
Gravatar
Thu Mar 05 15:42:25 -0800 2009
1
2
3
commit ed20f4dcc656ac55adbe9515466ef19d102e9ead
Author: Pratik Naik <pratiknaik@gmail.com>
Date: Thu Mar 5 22:45:04 2009 +0000
Gravatar
Thu Feb 26 06:45:25 -0800 2009
1
2
3
class ActiveRecord::Base
  def self.nullify(*args)
    callback = args.shift if ActiveRecord::Callbacks::CALLBACKS.include?(args.first)
Gravatar
Fri Feb 13 13:09:53 -0800 2009
1
2
3
Webrat.configure do |config|
  config.mode = :selenium
end