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 'Date' | |
| class Client | |
| attr_accessor :from, :msg | |
| attr_reader :at, :diff | |
| def initialize | |
| @at = Time.now | |
| 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
| I had to alter the recipe for couchdb available on opscode.com to work on engine yard. (http://community.opscode.com/cookbooks/couchdb) | |
| 1. EY still uses chef-solo 0.6 which requires the attributes file to be changed. trial and error found a working solution | |
| 2. EY is on gentoo and the service commands hang. Changed recipe to use the typical init.d path. Updated the init.d script. | |
| 3. added couchdb.yml template to add file to app_server:/data/[app_name]/shared/config | |
| FYI I commented out the reference to the erlang recipe for now as we've added the erlang package to the entire environment. |
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
| puts __FILE__ | |
| require "../service_locator.rb" | |
| require "test/unit" | |
| class TestServiceRegistry < Test::Unit::TestCase | |
| def test_registry | |
| reg = Service::Registry.new | |
| assert_not_nil(reg) | |
| assert_nil(reg[:bob]) |
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
| # first install erlang using the R13b04 formula | |
| brew install https://github.com/mxcl/homebrew/raw/810d52f4a386ea9e2b837030120ffd69cad73722/Library/Formula/erlang.rb | |
| # now you are free to install riak | |
| brew install riak |
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
| Rails::Initializer.run do |config| | |
| log = Logger.new(File.dirname(__FILE__) + "/../log/#{RAILS_ENV}.log") | |
| log.formatter = Logger::Formatter.new | |
| log.level = (Services.env == 'production') ? Logger::INFO : Logger::DEBUG | |
| log.datetime_format = "%Y-%m-%d %H:%M:%S " | |
| config.logger = log | |
| 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
| source 'http://rubygems.org' | |
| # gem 'goliath' | |
| gem 'goliath', :git => 'https://github.com/postrank-labs/goliath.git' | |
| gem 'em-http-request', '>= 1.0.0.beta.1' | |
| # gem 'em-http-request', :git => 'https://github.com/igrigorik/em-http-request.git' | |
| gem 'yajl-ruby' | |
| group :development, :test do |
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
| source 'http://rubygems.org' | |
| gem 'goliath', :git => 'https://github.com/postrank-labs/goliath.git' | |
| gem 'yajl-ruby' | |
| gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git', :require => 'eventmachine' | |
| gem 'em-http-request', :git => 'https://github.com/igrigorik/em-http-request.git' | |
| gem "em-synchrony", :git => 'https://github.com/igrigorik/em-synchrony.git' |
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
| # in enviornment.rb | |
| config.after_initialize do | |
| Mail.defaults do | |
| delivery_method :smtp, { :address => "smtp.gmail.com", | |
| :port => 587, | |
| :domain => 'domain.com', | |
| :from => '[email protected]', | |
| :user_name => '[email protected]', | |
| :password => 'secret', | |
| :authentication => :login, |
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
| Find the greatest product of five consecutive digits in the 1000-digit number. | |
| Make a program that recieves a string of numbers (see below) and outputs the answer | |
| 73167176531330624919225119674426574742355349194934 | |
| 96983520312774506326239578318016984801869478851843 | |
| 85861560789112949495459501737958331952853208805511 | |
| 12540698747158523863050715693290963295227443043557 | |
| 66896648950445244523161731856403098711121722383113 | |
| 62229893423380308135336276614282806444486645238749 |
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
| Convert a number between 1 and 4999 (integer only) to the roman numeral representation. | |
| make a command line program that takes 1 argument as a number and outputs the roman numerals. | |
| An online converter is available at http://www.onlineconversion.com/roman_numerals_advanced.htm |