Ubuntu precise64 box:
# Necessary software:
sudo apt-get install curl tmux vim
# Install RVM:
curl -L https://get.rvm.io | bash -s stable --autolibs=enabled
source /home/vagrant/.rvm/scripts/rvm
say "You call me on my car phone with that je ne se quois | |
you say you need a little of my ooh la la | |
I know you get lonely in your canopy bed | |
well say no more baby, I'll be running everywhere | |
say no more | |
Mon Amour | |
I'll bring my lovin' right to your front door | |
here I come | |
baby je'ta dour |
if defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby' | |
`say jay roOoOoOoOoOob ee` | |
else | |
`say 'matz is nice so we are on on mri'` | |
end |
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
I don't do: | |
<%= javascript_tag do %> | |
window.posts = <%= @posts.to_json %> | |
<% end %> | |
I do: | |
<div id="posts" data-url="<%= @posts %>"> | |
And the view is smart enough to know to call to_json on it, works for collections | |
Also: |
class SomeController < ApplicationController | |
def my_action | |
@things = [ {'name' => 'Matt'}, | |
{'name' => 'Ashe'}] | |
end | |
end |
require('coffee-script'); | |
var SimpleClass = require('./simple_class'); | |
var simple_class = new SimpleClass; | |
console.log(simple_class.foo()); |
# lib/decent_exposure/draper_strong_parameters_strategy.rb: | |
class DraperStrongParametersStrategy < DecentExposure::StrongParametersStrategy | |
def resource | |
super.decorate | |
end | |
end | |
# app/controllers/articles.rb |
source "https://rubygems.org" | |
gem 'rspec' |
Ubuntu precise64 box:
# Necessary software:
sudo apt-get install curl tmux vim
# Install RVM:
curl -L https://get.rvm.io | bash -s stable --autolibs=enabled
source /home/vagrant/.rvm/scripts/rvm
Shoes.app do | |
epsilon = 1.0/16 | |
offset = 250 | |
initial_x = 100 | |
initial_y = 100 | |
fill red | |
@animate = animate (2) do |i| |