Problem | AWS | DigitalOcean |
---|---|---|
Network isolation | Private Cloud/Security Groups | tinc / n2n / freelan |
Node initialization | CloudInit/User Data | ? |
Node discovery | EC2 API | Serf |
Pull app on scale | More Like This | Serf |
Distributed config | etcd | etcd |
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
module Kernel | |
# usage: | |
# require 'irb_drop' | |
# ...do some stuff... | |
# irb_drop(binding) # irb will open here with the current local variables | |
# ...continue doing stuff... | |
def irb_drop(context=nil, *argv) | |
require 'irb' | |
require 'pp' | |
require 'yaml' |
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
passenger nginx rails bundler status error | |
2.2.5 0.8.22 2.3.5 no OK | |
2.2.5 0.8.22 2.3.9 yes FAIL passenger not finding gems | |
2.2.5 0.8.50 2.3.9 yes FAIL couldn't compile | |
2.2.12 0.8.50 2.3.9 yes FAIL passenger not finding gems | |
2.2.13 0.8.50 2.3.9 yes FAIL PassengerHelper not starting | |
2.2.15 0.7.67 2.3.9 yes FAIL PassengerHelper not starting | |
2.2.15 0.8.50 2.3.9 yes FAIL PassengerHelper not starting | |
3.0.0.pre3 0.8.50 2.3.9 yes OK (requires libcurl4-openssl-dev) |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'time' | |
# USAGE: | |
# Put ids of IMDB shows here: | |
movie_ids = %w(tt0773262 tt0121955 tt0182576 tt0460649 tt0903747 tt0412142) |
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 Cart < ActiveRecord::Base | |
has_many :line_items | |
delegate :empty?, :to => :line_items | |
end | |
class User < ActiveRecord::Base | |
has_one :cart | |
end | |
@user = User.new |
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
module Kernel | |
# Terminate the current process - the hard way | |
def t! | |
`kill -9 #{$$}` | |
end | |
module_function :t! | |
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 'active_record' | |
require "#{Rails.root}/app/models/user" | |
describe User do | |
it "does something sweet" | |
it "does something cool" | |
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
module ActiveRecord | |
module ConnectionAdapters | |
module DatabaseStatements | |
# | |
# Run the normal transaction method; when it's done, check to see if there | |
# is exactly one open transaction. If so, that's the transactional | |
# fixtures transaction; from the model's standpoint, the completed | |
# transaction is the real deal. Send commit callbacks to models. | |
# | |
# If the transaction block raises a Rollback, we need to know, so we don't |
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
Here's the idea, | |
You work in tech. You're in the NYC area. | |
You care about "people" issues. You think the hardest problem in computing is "people". | |
You are interested in how we work. How to structure work. How to work together. | |
How to help your colleagues succeed. | |
And... | |
There's so much to learn: |
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
a = { foo: 'foo', bar: 'bar' } | |
b = { foo: 'fooo' } | |
# Reconcile duplicate keys | |
a.merge(b) {|k, old_v, new_v| [old_v, new_v].min} | |
# => { foo: 'foo', bar: 'bar' } | |
# Ever wanted Hash#map to return a hash? This is a workaround | |
a.merge(a) {|k, v| v.upcase} | |
# => { foo: "FOO", bar: "BAR" } |
OlderNewer