Skip to content

Instantly share code, notes, and snippets.

View leehambley's full-sized avatar

Lee Hambley leehambley

View GitHub Profile
#!/usr/bin/env perl
my $strXmlSnippet = <<-EOD
<BroadbandSimultaneousProvision minOccurs="0">
<CHOICE=PearsonGenerate>
<PearsonGenerate>OPTION["$$OPTION$$"]</PearsonGenerate>
</CHOICE=PearsonGenerate>
<CHOICE=OrderTypeForReferenceNumber>
<OrderTypeForReferenceNumber>OPTION["$$USWARN$$", "$$USBBRN$$"]</OrderTypeForReferenceNumber>
</CHOICE=OrderTypeForReferenceNumber>
task :alpha do
end
task :bravo do
end
task :charlie do
# this is a wrapper task
gem list --local | ack '(?:haml|rspec|cucumber|compass|rcov)' | awk '{print $1}' | xargs -n1 sudo gem uninstall –all
desc "Compress Javascripts"
task :compress_javascripts do
run "find /u/app/current/javascripts/ -name \"*.js\" | java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js"
end
desc "Compress Javascripts"
task :compress_javascripts do
run "cd /u/app/current/javascripts/"
run "find . -name "*.js" | java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js"
end
desc "Compress Javascripts"
task :compress_javascripts do
run "cd /u/app/current/javascripts/ && find . -name "*.js" | java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js"
end
find /u/app/current/javascripts -exec bash -c 'java -jar foo "$1" -o "${1%.js}-min.js"' _ {} \;
legacy:
adapter: mysql
database: database-name
username: root
password: your-pa55w0rd
host: localhost
LegacySession.establish_connection configurations['legacy']
class LegacySession < ActiveRecord::Base
# Establish Legacy Connection
LegacySession.establish_connection configurations['legacy']
# Force-Set The Table Name
# set_table_name is an instance level macro for:
# LegacySession.table_name :session
# See: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002289
set_table_name :session