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 Ticket < Sequel::Model | |
set_schema do | |
foreign_key :ticket_version_id, :table => :ticket_version | |
end | |
is(:versioned_fact, {:dimensions => [TicketVersion]}) | |
one_to_many :ticket_versions | |
end | |
class TicketVersion < Sequel::Model | |
set_schema 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
#Query LH for ticket, and update db cache. Allow ticket number or lh ticket object | |
def self.update_or_create_from_lighthouse(ticket, project_id) | |
lh_ticket = case ticket.class | |
when Fixnum: Ticket.retrieve_from_lh(ticket, project_id) | |
when Lighthouse::Ticket: Ticket.retrieve_from_lh(ticket.number, project_id) | |
else return false | |
end | |
if lh_ticket == 404 #delete ticket if it was deleted from LH |
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
#!/bin/sh | |
# VHostit | |
# Simple bash script to add a virtual host to apache & your hosts file on OS X | |
# | |
# Installation | |
# Throw vhostit.sh somewhere in your path. I like to copy it to /usr/local/bin/vhostit | |
# Usage | |
# `vhostit domain.tld` from within the directory you want to host. | |
# The domain.tld will be added to your hosts file and a VirtualHost added to your apache's httpd.conf\ | |
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 Spec::Example::ExampleGroup | |
def execute(*args, &block) | |
# DB = Merb::Orms::Sequel.connect | |
Merb::Orms::Sequel.connect.transaction do | |
super(*args, &block) | |
raise Sequel::Error::Rollback | |
end | |
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
ticket = Array.new | |
puts "$$ #{ticket.class}" | |
tick = case ticket.class | |
when Fixnum: 'Im a number' | |
when Array: "im an array" | |
else 'ELSE' | |
end | |
puts tick |
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
f = File.new("myfile.txt", "r") # open a file with read-mode | |
# ... do some stuff with the file, like read its content, ouput it on the screen or whatever | |
# finally: close it! | |
f.close | |
# or: | |
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
# Basic poolparty template | |
pool :cloudcompute do | |
instances 2..3 | |
cloud :app do | |
access_key ENV['AWS_ACCESS_KEY_ID'] || 'your_aws_key_id' | |
secret_access_key ENV['AWS_SECRET_ACCESS_KEY'] || 'your_aws_secret_key' | |
ami "ami-1cd73375" | |
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
................................................................................................................................./opt/local/lib/ruby/gems/1.8/gems/logging-0.9.4/lib/logging.rb:200: warning: already initialized constant MAX_LEVEL_LENGTH | |
........ | |
Pending: | |
Resource wrapped command global resources setting grabbing after already instantiated should grab the resource when called in in a block (Not Yet Implemented) | |
Called from ./spec/poolparty/pool/resource_spec.rb:362 | |
Finished in 7.662247 seconds | |
1168 examples, 0 failures, 1 pending |
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
Last login: Thu Nov 6 20:22:02 on ttys001 | |
Hi | |
mate .tahoe:~ | |
> mate .profile | |
tahoe:~ | |
> mate /tmp/ | |
.s.PGSQL.5432 aprFz850m launch-4OxnAy/ mysql.sock | |
.s.PGSQL.5432.lock aprcRNwgD launch-W48pgE/ passenger_status.15.fifo | |
.webdavUDS.7IOsib com.hp.launchport launch-yRcAvL/ ssh-X0LnAAuaKA/ | |
.webdavcache.232.FPWZ9D/ hsperfdata_fairchild/ launchd-143.gQzeWM/ ssh-b4OU5AwWSD/ |
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
PoolParty handles the dirty work for you. | |
PoolParty uses git-style commands to give you full-power of communication with your cloud in realtime! | |
TO-> | |
PoolParty handles the dirty work for you. Communicate with your cloud with Git-style commands in realtime! | |