Skip to content

Instantly share code, notes, and snippets.

@burningTyger
burningTyger / fix_19_spec.md
Created October 15, 2011 09:11
Rubinius: Fixing a failing spec for 1.9 mode. A simple introduction.

Last week I decided to fix some failing specs for Rubinius 1.9 mode. If you haven't done that before continue reading you will be surprised how easy that can be.

To get started you need a working clone of Rubinius. You can find instructions in the docs.

Now let's see what specs are failing. I consult the failing tags which can be found in:

rubinius/spec/tags/19/ruby/core

There are many specs still failing so I go through some and find something interesting in:

@erikfried
erikfried / MyModule.js
Created July 1, 2011 09:51
Testing YUI3 modules with Jasmine
YUI.add("my-module", function (Y) {
Y.namespace("mynamespace");
Y.mynamespace.MyModule = function () {
return {hello : "hello"};
};
}, '0.0.1' /*version*/, {
requires : ["base"]
});
describe PostsController do
describe "PUT #update" do
let(:post) { Factory(:post) }
context "when logged in as post's author" do
before { sign_in post.author }
it "allows the post to be updated" do
do_action
response.should be_success
@mrrooijen
mrrooijen / Gemfile
Created June 23, 2011 03:05
Heroku CoffeeScript, Compass, Sprockets in Rails 3.1.rc4
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc4'
gem 'sprockets', '!= 2.0.0.beta.11'
gem 'haml-rails'
gem 'sass-rails'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'coffee-script'
gem 'uglifier'
gem 'therubyracer'
@stympy
stympy / runchef.rb
Created May 25, 2011 13:40
A chef runner
#!/usr/bin/env ruby
require 'optparse'
require 'rubygems'
require 'net/ssh'
require 'yaml'
options = { :json => 'node.json', :config => 'chef-config.rb', :server => nil, :user => 'root' }
if config = YAML.load_file(File.join(File.dirname(__FILE__), 'server.yml'))
options.merge!(config)
@babelian
babelian / gist:982801
Created May 20, 2011 12:23
dynanic mass assign
class Project < ActiveRecord::Base
class << self
def always_attributes
%w{attributes anybody can edit}
end
def draft_attributes
%w{available only while project is being written}
@alexyoung
alexyoung / deploy.sh
Created May 17, 2011 10:47
Deployment script
#!/usr/bin/env bash
# Configuration
SERVER='myserver'
DEPLOY_TO='/path/to/app'
EXCLUDE='*.swp .git/ db/sphinx/ tmp/ log/'
DRY_RUN=false
DEPLOY_GEM_PATH='/opt/ec/ruby/1.8.7/lib/ruby/gems/1.8'
@quinn
quinn / all_the_toys.rb
Created April 14, 2011 16:25
all the fun stuff i use in my default stack!
# data
gem 'carrierwave'
gem 'fog'
gem 'mini_magick'
gem 'resque'
gem 'mysql', group: :development
gem 'pg', group: :production
# controllers and views
gem 'haml-rails'
@seven1m
seven1m / sass_with_jammit.rb
Created April 13, 2011 20:59
SASS with Jammit
# hack to auto compile sass when Jammit runs in Dev/Test mode
require 'haml/util'
require 'sass/engine'
module Jammit
module Helper
SASS_TIMESTAMPS = {}
def include_stylesheets_with_sass(*packages)