This file contains hidden or 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 -w | |
# This should be run through './script/runner' | |
options = YAML.load($stdin.read) | |
demo = Demo.find(options[:demo]) | |
runner = Outback::Runner.new | |
runner.manager = demo.manager |
This file contains hidden or 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 -w | |
# This should be run through './script/runner' | |
options = YAML.load($stdin.read) | |
demo = Demo.find(options[:demo]) | |
runner = Outback::Runner.new | |
runner.manager = demo.manager |
This file contains hidden or 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 'stringio' | |
require 'irb/ruby-lex' | |
# Tell the ruby interpreter to load code lines of required files | |
# into this filename -> lines Hash. This behaviour seems to be | |
# very undocumented and therefore shouldn't really be relied on. | |
SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ | |
module ProcSource | |
def get_lines(filename, start_line = 0) |
This file contains hidden or 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 Manager < ActiveRecord::Base | |
belongs_to :demo | |
serialize :state | |
serialize :cache | |
def after_initialize | |
@observers = [] | |
end | |
This file contains hidden or 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
Loading development environment (Rails 2.1.0) | |
>> m = Manager.new | |
=> #<Manager id: nil, state: nil, cache: nil, kind: nil, demo_id: nil, created_at: nil, updated_at: nil> | |
>> m.cache | |
Restoring state:--- | |
cache: | |
state: | |
=> {} | |
>> m.cache[:name] = "Mike" |
This file contains hidden or 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
>> m.read_attribute(:cache) | |
=> {:monkey=>321} | |
>> m.save | |
=> true | |
>> m.read_attribute(:cache) | |
=> {:monkey=>321} | |
>> m = Manager.find(m.id) | |
=> #<Manager....> | |
>> m.read_attribute(:cache) | |
=> {:monkey=>123} |
This file contains hidden or 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 'httparty' | |
class Bitly | |
URL = 'http://bit.ly' | |
include HTTParty | |
base_uri URL | |
def initialize(url) | |
case url |
This file contains hidden or 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 | |
# | |
# ./script/demodblogger | |
# | |
# Designed to assist with running a command in the background and capturing | |
# its output as it runs, this script takes a demo id, and calls | |
# @demo.job_log(line) for each line given it on stdin. Run without arguments for a | |
# brief summary of usage. | |
# | |
This file contains hidden or 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
#import "planet.h" | |
#include <iostream> | |
using namespace std; | |
const double G = 1; | |
const double m_sun = 1; | |
const double m_earth = 1; | |
This file contains hidden or 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
Traceback (most recent call last): | |
File "/usr/local/python26/bin/paster", line 8, in <module> | |
load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')() | |
File "/usr/local/python26/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run | |
invoke(command, command_name, options, args[1:]) | |
File "/usr/local/python26/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke | |
exit_code = runner.run(args) | |
File "/usr/local/python26/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 68, in run | |
return super(AbstractInstallCommand, self).run(new_args) | |
File "/usr/local/python26/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run |
OlderNewer