Skip to content

Instantly share code, notes, and snippets.

@justinhennessy
justinhennessy / gist:7081250
Created October 21, 2013 09:43
Mycharity git document
@justinhennessy
justinhennessy / gist:6678630
Last active December 23, 2015 18:49
Supporter API test commands

Campaign list

Command line

curl -i https://everydayhero.com/api/v2/campaigns.json?charity_id=au-2

In the browser

https://everydayhero.com/api/v2/campaigns.json?charity_id=au-2
@justinhennessy
justinhennessy / gist:6173402
Last active December 20, 2015 18:08
Class methods discussion
def user_with_highest_kilometers
highest = User.new
users.each do |user|
highest = user if user_distance_sum(user) > user_distance_sum(highest)
end
highest
end
def user_with_highest_ascent
highest = User.new
@justinhennessy
justinhennessy / queue_fix.rb
Last active December 19, 2015 22:28 — forked from stuart/queue_fix.rb
De dup RabbitMQ queue
!#/usr/env ruby
require 'json'
require 'uri'
# Removes repeated USER records from one of the AMQP queues.
#
# USAGE: ruby queue_fix.rb "queue_name" "email_address"
#
# This will dump the whole queue to a temp file. (In case anything goes wrong)
# it will strip out the user messages containing the email provided then

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods

Capybara

save_and_open_page

Matchers

have_button(locator)
@justinhennessy
justinhennessy / gist:5333624
Last active December 15, 2015 22:29
vi cheat sheet

Add something to the end of a line

1,$ s/$/",/g

Add something to the start of a line

1,$ s/^/"/g

Turn on/off line numbers