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.getIndexes(); | |
[ | |
{ | |
"name" : "_id_", | |
"ns" : "test.collection", | |
"key" : { | |
"_id" : 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
# Rails 2 way. | |
SomeController.new.process( request, response ) | |
# Rails 3 way. | |
status, headers, body = SomeController.action(:show).call(request.env) | |
response = ActionDispatch::Response.new(status, headers, body) | |
self.response_body = response |
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 MicropostsController < ApplicationController | |
before_filter :set_micropost, :only => [:show, :edit, :update, :create, :new] | |
before_filter :authenticate, :only => [:create, :destroy] # Same here? | |
# Omitted. | |
def destroy | |
@micropost.destroy | |
redirect_back_or root_path |
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 Utf8Header < Thor | |
desc "add", "Add Content UTF-8 on top of all .rb/.feature files" | |
# copy & pasted from https://gist.github.com/738245 | |
def add | |
files = Array.new | |
["*.rb", "*.rake","*.feature"].each do |extension| | |
files.concat(Dir[ File.join(Dir.getwd.split(/\\/), "**", extension) ]) | |
end | |
files.each do |file| |
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
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'capybara-webkit' | |
Capybara.run_server = false | |
Capybara.current_driver = :webkit | |
Capybara.app_host = 'http://www.google.com' | |
module MyCapybaraTest |
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 Array | |
def include_by_regexp_or_string?(str) | |
any? do |o| | |
o.is_a?(Regexp) ? o =~ str : o == str | |
end | |
end | |
end |
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
Day job: Software Engineer at Swipely | |
Your Rails contributions (if any): Around six or so bug fixes to rails. Have also fixed bugs in a bunch of other gems. Recent contributor to rubygems.org. | |
What's your Ruby/Rails experience?: Been working with rails off and on since around 2006. Full time Rails developer currently. | |
How do you use GitHub?: All of my source code, dotfiles, projects in progress, contributing to other projects. |
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
# coffeescript issue | |
vows = require('vows') | |
tobi = require('tobi') | |
should = require('should') | |
getBrowser = () -> | |
tobi.createBrowser(80, 'www.google.com') | |
vows |
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
vows = require('vows') | |
tobi = require('tobi') | |
should = require('should') | |
vows | |
.describe('Test') | |
.addBatch | |
'A hit': | |
topic: () -> | |
browser = tobi.createBrowser(80, 'www.yahoo.com') |
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
{ | |
"author": "drip <drip@drip.io>", | |
"name": "drip", | |
"description": "npm continuous integration", | |
"version": "0.0.1-5", | |
"repository": { | |
"url": "https://github.com/drip/drip.git" | |
}, | |
"engines": { | |
"node": "~v0.4.7" |