Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
class App | |
def initialize(primary_force, secondary_force, delay, mass) | |
@primary_force = primary_force | |
@secondary_force = secondary_force | |
@delay = delay | |
@mass = mass | |
end | |
def distance_traveled(time) | |
acc = @primary_force / @mass |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.3.deb | |
sudo dpkg -i elasticsearch-0.90.3.deb | |
sudo service elasticsearch start | |
sudo service elasticsearch start | |
# If you see "WARNING: ElasticSearch may have failed to start." |
$VERBOSE = nil | |
require File.expand_path('../rooby', __FILE__) | |
Person = Rooby::Class.new 'Person' do | |
define :initialize do |name| | |
@name = name | |
end | |
define :name do |
describe Coderetreat do | |
describe ".todays" do | |
it "only includes retreats for today" do | |
todays_event = FactoryGirl.create(:coderetreat, scheduled_for: Date.today) | |
FactoryGirl.create(:coderetreat, scheduled_for: Date.yesterday) | |
FactoryGirl.create(:coderetreat, scheduled_for: Date.tomorrow) | |
Coderetreat.todays.should =~ [todays_event] | |
end | |
end |
This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.
Many thanks to funny-falcon for the performance patches.
# app/presenters/user_presenter.rb | |
class UserPresenter | |
def initialize(user) | |
@user = user | |
end | |
def as_json(*) | |
{ | |
'id' => @user.id, |
default: | |
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %> | |
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %> | |
region: <%= ENV['S3_REGION'] %> |