Skip to content

Instantly share code, notes, and snippets.

From bd8aa4106da1aa9f92aafceeac0701b7cf7962bd Mon Sep 17 00:00:00 2001
From: Adam Phillips <aphillips@scholastic.co.uk>
Date: Mon, 4 Mar 2013 09:46:49 +0000
Subject: [PATCH 1/2] Modified as shared helper to reduce typing
Now that the as helper has had more use, it's become apparent that most
cases benefit from using the display_name parameter to describe the kind
of user being tested. Therefore, in order to reduce typing, the helper
has been changed so that if the second parameter passed is a string, it
is taken to be the display name.
@adamphillips
adamphillips / gist:3608009
Created September 3, 2012 09:03
Sublime text 2 shortcuts

Sublime Text 2 Keyboard Shortcuts (OSX)

Bookmarks

Cmd + F2 : Toggle bookmark

F2 : Jump to next bookmark

Shift + F2 : Jump to prev bookmark

@adamphillips
adamphillips / deploy.rb
Created March 30, 2012 18:52 — forked from netzpirat/deploy.rb
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@adamphillips
adamphillips / Javascript dateDiff function to calculate difference in terms of days, months and years
Created October 6, 2010 00:17
A quick javascript dateDiff function that returns results in terms of days, months and years taking into account variable month lengths and leap years
/*
* Function to calculate the absolute difference in days, months and years between 2 days taking into account variable month lengths and leap years
* It ignores any time component (ie hours, minutes and seconds)
*
*/
function dateDiff(dt1, dt2)
{
/*
* setup 'empty' return object
*/