This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
config.filter_run :focus => true | |
end | |
describe "something" :focus => true do | |
... | |
end | |
describe "another thing" do | |
it "should be testable" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'autotest', :group => :test | |
gem 'capybara', :group => :test | |
gem 'cucumber', :group => :test | |
gem 'cucumber-rails', :group => :test | |
gem 'database_cleaner', :group => :test | |
gem 'factory_girl', :group => :test | |
gem 'haml' | |
gem 'haml-rails' | |
gem 'jammit' | |
gem 'jquery-rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ base git:(master) ✗ RAILS_ENV=test rake spec --trace | |
(in /Users/Bruno/Projects/Personal/base) | |
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead.. (called from <top (required)> at /Users/Bruno/.rvm/gems/ruby-1.9.2-rc1/gems/activesupport-2.3.5/lib/activesupport.rb:2) | |
** Invoke spec (first_time) | |
** Invoke db:test:prepare (first_time) | |
** Invoke db:abort_if_pending_migrations (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:abort_if_pending_migrations | |
** Execute db:test:prepare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
CREATE FUNCTION QUADRIMESTER (date_and_time DATETIME) | |
RETURNS INT(1) | |
BEGIN | |
DECLARE month_of_the_year INT(1); | |
SET month_of_the_year = MONTH(date_and_time); | |
IF month_of_the_year >= 1 AND month_of_the_year <= 4 THEN RETURN 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
struct node { | |
int value; | |
struct node *next; | |
}; | |
typedef struct node node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Page | |
include Mongoid::Document | |
field :title | |
field :body | |
field :permalink | |
validates_presence_of :title, :body | |
before_validation :generate_permalink | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes | |
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/ | |
# Work with 64bit kernel mode | |
set -e | |
PREFIX=/usr/local | |
# Passenger users: amend your Apache global configuration with the following directive | |
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Campaign | |
include Mongoid::Document | |
field :name | |
index :name, :unique => true | |
validates_presence_of :name | |
end | |
describe Campaign do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.collection.group([fields], { conditions }, { :initial => value }, Mongo::Code.new("function (obj, prev) { prev.count++; }")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clear chains | |
iptables -F | |
# Allow outgoing traffic and disallow any passthroughs | |
iptables -P INPUT DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD DROP | |
# Allow traffic already established to continue | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT |