This file contains 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 SubscriptionTransaction | |
named_scope :today, | |
:conditions => ['created_at > ? and created_at < ?', | |
Time.new.beginning_of_day, Time.new.tomorrow.beginning_of_day] | |
--------class Subscription | |
named_scope :due_today, | |
#:include => [:customer], |
This file contains 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
#-- | |
# | |
# Utility for creating Google Maps Encoded GPolylines | |
# | |
# License: You may distribute this code under the same terms as Ruby itself | |
# | |
# Author: Joel Rosenberg | |
# | |
# ( Drawing from the official example pages as well as Mark McClure's work ) | |
# |
This file contains 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
# polyline_decoder.rb by George Lantz August 2007 | |
# Usage Example: | |
# | |
# line = "{b~zEdruxPT?L|@PP" |
This file contains 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 ApplicationHelper | |
def link_to_remove_fields(name, f) | |
f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)") | |
end | |
def link_to_add_fields(name, f, association) | |
new_object = f.object.class.reflect_on_association(association).klass.new | |
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| | |
render(association.to_s.singularize + "_fields", :f => builder) | |
end |
This file contains 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
############## plugin commands ################# | |
# RSpec is the original Behaviour Driven Development framework for Ruby. | |
plugin 'rspec', | |
:git => "git://github.com/dchelimsky/rspec.git" | |
# The world's greatest templating system | |
plugin 'haml', | |
:git => "git://github.com/nex3/haml.git" |
This file contains 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
rake("gems:install", :sudo => true) | |
gem 'install_theme' | |
#gem 'haml' | |
#run 'haml --rails .' | |
gem 'mislav-will_paginate', :lib => 'will_paginate' | |
#gem 'rubyist-aasm' | |
plugin 'resource_controller', |
This file contains 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
export PS1="\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\ 033[37m\]$\[\033[00m\] " |
This file contains 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 'rubygems' | |
gem 'scrapi' | |
require 'scrapi' | |
# Parse bens bargains! | |
URL = 'http://bensbargains.net/' | |
scraper = Scraper.define do | |
array :posts | |
process '.newsText', :posts => Scraper.define { |
This file contains 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 'rubygems' | |
require 'irb/completion' | |
require 'map_by_method' | |
require 'what_methods' | |
require 'pp' | |
require 'hirb' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
# Tell irb how much it should remember and where |
NewerOlder