Skip to content

Instantly share code, notes, and snippets.

# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
gondwana master / $ rvm info
ree-1.8.7-head@gondwana:
system:
uname: "Darwin mbp.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/usr/local/bin/zsh => zsh 4.3.10 (i386-apple-darwin10.4.0)"
rvm:
@zenom
zenom / gist:703740
Created November 17, 2010 18:02
rvm.sh
#!/bin/bash
CHANGE=0;
if [ $RUBY_VERSION != $ORIG_RUBY ]; then
ORIG_RUBY=$RUBY_VERSION;
CHANGE=1;
fi
if [ "$ORIG_GEMSET" != "$rvm_gemset_name" ]; then
ORIG_GEMSET=$rvm_gemset_name;
CHANGE=1;
var Twitter = Backbone.Controller.extend({
REFRESH_INTERVAL: 10000,
el: $('#left'),
routes: {
"twitter": "twitter",
},
initialize: function() {
_.bindAll(this, 'addOne', 'addAll', 'fetchLatest');
Tweets.bind('refresh', this.addAll);
var Wall = Backbone.Controller.extend({
routes: {
"wall": "index"
},
initialize: function() {
console.log('controller initialized');
},
index: function() {
@zenom
zenom / spec.rb
Created November 9, 2010 13:33
spec_helper.rb
scenario "have ability to edit profile", :js => true do
@ability.should be_able_to(:edit, @profile)
end
$(document).ready(function() {
// 4cd5b71dd64d240a09000001
Backbone.sync = function(method, model) {
alert(method + ' -- ' + model.url);
};
//var Tweet = Backbone.Model.extend({});
//var test = new Tweet;
# base folder path to look for watch folders
BASE_FOLDER_PATH = '\\\\192.168.222.50\main-content-backup'
ap '%s' % Settings::BASE_FOLDER_PATH
ap path
"\\\\192.168.222.50\\main-content-backup"
Notice the \\ now before main-content-backup
class Post
require 'carrierwave/orm/mongoid'
include Mongoid::Document
include Mongoid::Timestamps # adds created_at and updated_at fields
include Mongoid::Slug
include Mongoid::Paranoia
include Stateflow
# relations
referenced_in :source
class Source
include Mongoid::Document
include Mongoid::Slug
include Mongoid::Timestamps # adds created_at and updated_at fields
attr_reader :twitter_username, :rss_username
embeds_one :twitter, :class_name => "Twitter"
# fields