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
Merb.logger.info("Compiling routes...") | |
Merb::Router.prepare do |r| | |
# RESTful routes | |
r.resources :songs | |
# This is the default route for /:controller/:action/:id | |
# This is fine for most cases. If you're heavily using resource-based | |
# routes, you may want to comment/remove this line to prevent |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>beforeRunningCommand</key> | |
<string>nop</string> | |
<key>bundleUUID</key> | |
<string>5A9D4FC6-6CBE-11D9-A21B-000D93589AF6</string> | |
<key>command</key> | |
<string>#!/usr/bin/env ruby -rcgi |
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
def parameterize(xml) | |
xml.gsub!('{iterator}', iterator_id.blank? ? 'Start' : 'Continue') | |
xml.gsub!('{iterator_id}', iterator_id || '') | |
xml.gsub!('{from_modified_date}', ((transactions_last_synced_on || 10.years.ago) - 1.day).to_s(:qb_date)) | |
xml.gsub!('{to_modified_date}', (Time.now + 1.day).to_s(:qb_date)) | |
xml | |
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
in routes.rb | |
map.resources :staff, :member => {:graph_code=>:get} | |
in controller, | |
@graph = open_flash_chart_object(500,300, graph_code_staff_path( {:title=>'Timesheet', :conditions=>@conditions})) | |
in view, error: | |
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
it "should get another hmac" do | |
bs = 'GET&http%3A%2F%2Fterm.ie%2Foauth%2Fexample%2Frequest_token.php&oauth_consumer_key%3Dkey%26oauth_nonce%3DuhnyjcnYEyO9vUxPAcdttE0OqbFPgBOp2xv7XmN6bw%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1223595784%26oauth_token%3Dtoken%26oauth_version%3D1.0' | |
@oa.signature(bs, 'secret', '').should == "cumMcmS4gQG5pcrtlgckPv/V0WU=" | |
end | |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'fileutils' | |
require 'yaml' | |
# TODO | |
# - pulling a specific UUID/Tag (gitspec hash) with clone/update | |
# - a 'deploy' task (in addition to 'redeploy' ?) | |
# - add merb:gems:refresh to refresh all gems (from specifications) |
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 Project < Sequel::Model | |
one_to_many :milestones | |
one_to_many :tickets | |
def self.update_from_lighthouse(project_id=nil, updated_at=nil) | |
#TODO: allow scoping this call to only records updated_at>? | |
Lighthouse::Project.find(:all).each do |lh_project| | |
if project=Project[lh_project.id] | |
project.update_from_lighthouse | |
else |
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
#!/usr/bin/env ruby | |
# 2008.10.03 | |
# JD Huntington | |
# shell script to assist in working with lighthouse and git | |
# requires lighthouse api ruby wrapper from http://github.com/Caged/lighthouse-api/tree/master | |
LIB_DIR='~/lib' # Absolute location of lighthouse.rb and lighthouse-api.rb | |
TOKEN='' # Insert your lighthouse token | |
ACCOUNT='' # Insert your lighthouse account name |
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 TicketNumbersMigration < Sequel::Migration | |
def up | |
alter_table(:tickets) do | |
add_column 'number', :integer | |
end | |
end | |
def down | |
alter_table(:tickets) do |
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
abbot(fairchild@abbot) :~/WebApps/lightsheet2 | |
> ls gems/gems/httparty-0.1.3/lib/ | |
httparty/ httparty.rb | |
abbot(fairchild@abbot) :~/WebApps/lightsheet2 | |
> merb -i | |
Warning: please use bin/merb to load merb-core-0.9.9 from ./gems | |
Loading init file from /home/fairchild/WebApps/lightsheet2/config/init.rb | |
Loading /home/fairchild/WebApps/lightsheet2/config/environments/development.rb | |
~ Loaded DEVELOPMENT Environment... | |
~ |
OlderNewer