Skip to content

Instantly share code, notes, and snippets.

View tinogomes's full-sized avatar
😀

Celestino Gomes tinogomes

😀
View GitHub Profile
// Load dependencies
var app = require("./lib/server").createServer(),
sys = require("sys");
// Start app server
app.listen(3002);
app.get("/:name", function(req, res){
res.render("Hello " + req.params.name);
});
require 'rubygems'
require 'test/unit'
require 'redgreen'
class Card
attr_reader :suite, :value
def initialize(options={})
@suite = options[:suite]
@value = options[:value]
@jlindley
jlindley / config.ru
Created April 18, 2011 17:03
Rails 2.3.x config.ru (to allow using http://pow.cx/ )
require "./config/environment"
use Rails::Rack::LogTailer
use Rails::Rack::Static
run ActionController::Dispatcher.new
@samnang
samnang / Rakefile
Created April 29, 2011 03:57
Register RSpec rake's tasks
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
rescue LoadError
task :spec do
abort "Please run `bundle install` to install RSpec."
end
end
@drnic
drnic / $
Created June 10, 2011 15:20
never fear $ in tutorials again
#!/usr/bin/env bash
"$@"
@klauswuestefeld
klauswuestefeld / gist:1103582
Created July 25, 2011 04:55
PrevaylerJr - "To serve the persistence needs of 99% of information systems in the world using 23 semicolons."
import java.io.*;
public class PrevaylerJr {
public static interface Command extends Serializable {
Object executeOn(Object system);
}
@otobrglez
otobrglez / dropbox.rake
Created August 25, 2011 10:01
Rake task for moving Heroku PostgreSQL backups to Dropbox (Rails)
# By Oto Brglez - @otobrglez
# Rake task. Put in your (lib/tasks) folder of your Rails application
# Execute with "rake dropbox:backup"
# Configuration must be inside config/dropbox.yml file
namespace :dropbox do
desc "Backup production database to dropbox"
task :backup do
@klauswuestefeld
klauswuestefeld / gist:1186975
Created September 1, 2011 19:03
Martin Fowler to Usurp Pattern
We couldn’t find that file to show.
@ryanb
ryanb / spec_helper.rb
Created September 12, 2011 21:29
Focus on specific specs in RSpec
# add this to your spec helper
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
# and then use the :focus tag in your specs
it "does something awesome", :focus do
@ryanb
ryanb / spec_helper.rb
Created September 12, 2011 21:37
Use RSpec tags to add behavior around specs.
# Add this to your spec_helper.rb
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.around(:each, :vcr) do |example|
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/")
VCR.use_cassette(name, :record => :new_episodes) do
example.call
end
end
end