Jon Buda jonbuda

View timezonefinder.rb
1 2 3 4 5 6 7 8 9
# offset = TimeZoneFinder.gmt_offset(some_lat, some_lng)
# timezone = ActiveSupport::TimeZone[offset]
#
# timezone = TimeZoneFinder.timezoneId(lat, lng)
# Time.zone = timezone
# Time.zone.now
#
class TimeZoneFinder
attr_accessor :result
View jquery.rake
1 2 3 4 5 6 7 8 9 10
namespace :jquery do
desc "Installs the latest version of jQuery and the rails.js UJS jQuery Adapter"
task :install => :update do
puts "Installed jQuery and the rails.js UJS jQuery Adapter"
puts %Q{
******************************************************************************
 
You can update your javascript defaults in Rails3 with the following:
 
in application.rb, add:
View setup_load_paths.rb
1 2 3 4 5 6 7 8 9 10
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
# RVM is unavailable at this point.
raise "RVM ruby lib is currently unavailable."
View setup_load_paths.rb
1 2 3 4 5 6 7 8 9 10
# This allows you to use Passenger with RVM where each app has it's own gemset
# place the setup_load_paths.rb into your config folder of Rails app
 
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
View gist:376728
1 2 3 4 5 6 7 8
DAYS_BEFORE_OPTIONS = [0,1,2,3,4,5,6,7,14,21,28]
DAYS_BEFORE_IN_WORDS = ['the day of'] + (1..6).map {|day| "#{day} days before"} + (1..4).map {|week| "#{week} weeks before"}
 
def self.options_for_days_before
DAYS_BEFORE_OPTIONS.map do |days|
[DAYS_BEFORE_IN_WORDS[DAYS_BEFORE_OPTIONS.index(days)], days]
end
end
View revised-font-stack.css
1 2 3 4 5 6 7 8 9 10
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
 
*/
 
 
 
/*
Something went wrong with that request. Please try again.