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
# 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 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 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 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 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 'msgpack' | |
require 'msgpack/rpc' | |
class Logr | |
attr_accessor :client | |
def initialize(ip) | |
@client = MessagePack::RPC::Client.new(ip, 9090) | |
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
#---------------------------------------------------------------------------- | |
# Rotate log files (50 files max at 1MB each) | |
#---------------------------------------------------------------------------- | |
log_path = '#{Rails.root}/log/#{Rails.env}.log' | |
gsub_file 'config/application.rb', /(< Rails::Application.*)/ , "\\1\n config.logger = | |
Logger.new(\"#{log_path}\", 50, 1048576)" |
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
#---------------------------------------------------------------------------- | |
# Choose Javascript Framework | |
#---------------------------------------------------------------------------- | |
run 'mkdir public/uploads && chmod 777 public/uploads' | |
run 'mkdir public/ui' | |
ask_js = ask("\r\n\r\nWhat javascript framework do you want to use?\r\n\r\n(1) Prototype\r\n(2) jQuery\r\n(3) MooTools\r\n(4) RightJS") | |
if ["1", "2", "3", "4"].include?(ask_db_type) | |
@prototype = (ask_db_type=="1") | |
@jquery = (ask_db_type=="2") |
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
#---------------------------------------------------------------------------- | |
# Git Setup | |
#---------------------------------------------------------------------------- | |
file '.gitignore', <<-FILE | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 | |
public/uploads/* |
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
$ curl -X PUT -v -F value=@bauhaus.jpg http://localhost:9292/test/bauhaus.jpg | |
* About to connect() to localhost port 9292 (#0) | |
* Trying ::1... Connection refused | |
* Trying fe80::1... Connection refused | |
* Trying 127.0.0.1... connected | |
* Connected to localhost (127.0.0.1) port 9292 (#0) | |
> PUT /test/bauhaus.jpg HTTP/1.1 | |
> User-Agent: curl/7.21.0 (x86_64-apple-darwin10.4.0) libcurl/7.21.0 OpenSSL/1.0.0a zlib/1.2.5 libidn/1.19 | |
> Host: localhost:9292 | |
> Accept: */* |
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
//Add the following category to CPToolbar | |
@implementation CPToolbar (selectables) | |
- (CPToolbar)initWithSelector:(CPString)anId forWindow:(CPWindow)aWindow | |
{ | |
if(self = [self initWithIdentifier:anId]) | |
{ | |
var mainBundle = [CPBundle mainBundle], | |
image = [[CPImage alloc] initWithContentsOfFile:[mainBundle pathForResource:@"selected.png"] |