Skip to content

Instantly share code, notes, and snippets.

View samflores's full-sized avatar
🦕

Samuel Flores samflores

🦕
View GitHub Profile
## task_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Task do
include ValidTaskAttributes
# o módulo ValidTaskAttributes define o método valid_task que retorna
#{
# :name => "Task name",
# :description => "Task description",
# :alias => "task_alias",
## task_spec.rb
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Task do
include ValidTaskAttributes
# o módulo ValidTaskAttributes define o método valid_task que retorna
#{
# :name => "Task name",
# :description => "Task description",
# :alias => "task_alias",
@samflores
samflores / remarkable_way.rb
Created April 13, 2009 20:51 — forked from josevalim/remarkable_way.rb
Remarkable X RSpec
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe FeedbacksController do
mock_models :feedback
describe :get => :new, :id => '42' do
expects :new, :on => Feedback, :returns => mock_feedback
should_assign_to :feedback, :with => mock_feedback
end
require "redis"
@redis = Redis.new(:timeout => 0)
@redis.subscribe('a', 'b') do |on|
on.subscribe do |klass, num_subs|
puts "Subscribed to #{klass} (#{num_subs} subscriptions)"
end
on.message do |klass, msg|
puts "#{klass} received: #{msg}"
source :rubygems
# Project requirements
gem 'rake'
gem 'rack-flash'
gem 'thin' # or mongrel
# Component requirements
gem 'compass', '~> 0.11.beta.6'
gem 'sass', '~> 3.1.0.alpha.253'
@samflores
samflores / gist:1126811
Created August 5, 2011 02:27
rvm install rbx-2.0.0pre -- --enable-version=1.9,1.8 --default-version=1.9
[2011-08-04 23:15:48] /Users/samflores/.rvm/wrappers/ruby-1.8.7-p352/rake install
/Users/samflores/.rvm/rubies/ruby-1.8.7-p352/bin/ruby vm/codegen/encoding_extract.rb /Users/samflores/.rvm/src/vendor/onig vm/gen/encoding_database.cpp
(in /Users/samflores/.rvm/src/rbx-2.0.0pre)
/Users/samflores/.rvm/rubies/ruby-1.8.7-p352/bin/ruby vm/codegen/field_extract.rb vm/builtin/basicobject.hpp vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/alias.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/bytearray.hpp vm/builtin/chararray.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/class.hpp vm/builtin/compiledmethod.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp vm/builtin/immediates.hpp vm/builtin/iseq.hpp vm/builtin/list.hpp vm/builtin/lookuptable.hpp vm/builtin/ffi_pointer.hpp vm/builtin/metho
Configuring LLVM...
Checking for existing LLVM library tree: found!
Checking sizeof(long): 8 bytes
Checking platform endianness: little endian
Checking tr1/hash definition: found
Checking for x86_32: no
Checking for function 'backtrace': found!
Checking for function 'readline': found!
Checking curses library: curses
#!/bin/bash
BUNDLED_COMMANDS="cucumber heroku rackup rails irb rake rspec ruby shotgun spec spork guard ripl padrino"
## Functions
bundler-installed() {
which bundle > /dev/null 2>&1
}
@samflores
samflores / steps.txt
Created November 6, 2011 14:34
Fix LoL Transgaming C Error
- visit http://www.dll-files.com/dllindex/dll-files.shtml?msvcr80
- download and uncompress zip file
- place msvcr80.dll on [Show package contents of LoL > Resources > transgaming > c_drive > windows > system32]
@samflores
samflores / foo.rb
Created November 8, 2011 15:26
RSpec comparison
class Foo
def say
"Hello"
end
end