Skip to content

Instantly share code, notes, and snippets.

@dbainbridge
dbainbridge / app.js
Created April 19, 2012 20:48
How to use socket.io with Express 3
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http');
var app = express();
var server = app.listen(3000);
@barraponto
barraponto / drush_bash.sh
Created January 25, 2012 11:09
Drush Bash Tricks
# Drush-Bash tricks 0.2
# Copyright Nuvole 2010, Capi Etheriel 2012.
# License: GPL 3, see http://www.gnu.org/licenses/gpl.html
# For a quick start: copy this entire file to the end of the .bashrc
# file in your home directory and it will be enabled at your next
# login. See http://nuvole.org/node/26 for more details and options.
# Drupal and Drush aliases.
# To be added at the end of .bashrc.
@mattheworiordan
mattheworiordan / capybara_webkit_screenshot_env.rb
Created August 19, 2011 12:26
Cucumber and Capybara-Webkit automatic screenshots on failure
def screen_shot_and_save_page
require 'capybara/util/save_and_open_page'
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}"
Capybara.save_page body, "#{path}.html"
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png"
end
begin
After do |scenario|
screen_shot_and_save_page if scenario.failed?