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
Host Hack Night: @flagged @context(Connected) @autodone(true) | |
- Schedule in MeetUp @defer(Hack Night -10d 9:00) @due(Hack Night -7d) | |
- Tweet event URL | |
- Post event in Slack channels | |
- Invite people via email @due(Hack Night -3d) | |
- Retweet event URL @defer(Hack Night -1d 9:00) @due(Hack Night -1d 16:00) | |
- Order Pizza @defer(Hack Night 9:00) @due(Hack Night 15:00) | |
- Log expense in Harvest | |
- Schedule next Hack Night in Workflow @defer(Hack Night 21:00) |
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
Load testing vs performance testing | |
A common mistake made in our industry is to conflate performance testing with | |
load testing. While both are important, neither is a substitute for the other. | |
The former helps assess whether a system is performant. Can it accomplish some | |
task in a short enough period of time to be effective? The latter is used to | |
understand how the performance changes as more and more demand is put on the | |
system. I came to appreciate the value of both while working for AOL back at | |
the time when 30 million people looked to that service as the way to get |
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 ApplicationController < ActionController::Base | |
before_filter :set_pagination_defaults, :inline_file_downloads | |
protect_from_forgery | |
layout 'general' | |
def set_pagination_defaults | |
params[:page] ||= 1 | |
params[:per_page] ||= 10 | |
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
/* How does one unit test this? */ | |
$(document).ready(function() { | |
$('#map-searchform .searchform-fields label').inFieldLabels(); | |
$('#map-search-form').submit(function (e) { | |
e.preventDefault(); | |
$('#map').map_control().find($('#map-search-terms').val()); | |
}); | |
}); |
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
- content_for :head_libraries, jquery_include_tags(:jquery_ui => false) | |
- content_for :head, javascript_include_tag('application') | |
.scrollable | |
.items | |
.homepage_slot.slot_1 | |
= image_tag 'building.jpg' | |
.homepage_slot.slot_2 | |
= image_tag 'alleluia.jpg' | |
.homepage_slot.slot_3 |
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 "heroku" | |
require "heroku/command" | |
require 'aws/s3' | |
namespace :backups do | |
desc "create a pg_dump and send to S3" | |
task :backup => :environment do | |
include RRBOUtil |
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 BraintreeSimulationController < ApplicationController | |
VALID_CC_NUMBERS = [ '4111111111111111', '5431111111111111', '6011601160116611', '341111111111111' ] | |
def transact | |
if params[:merchant_defined_field_1] == 'billing' | |
current_user.update_attributes( :bill_to_first_name => params[:firstname], | |
:bill_to_last_name => params[:lastname], | |
:bill_to_address => params[:address1], | |
:bill_to_address2 => params[:address2], | |
:bill_to_city => params[:city], |
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
desc "Use Google to get and XML geocode response for address" | |
task :geocode => :environment do | |
require 'geokit' | |
address_str = ENV['address'] | |
if address_str.nil? | |
puts "Usage: rake geocode address='address to geocode'" | |
end | |
url = "http://maps.google.com/maps/geo?q=#{Geokit::Inflector::url_escape(address_str)}&output=xml&key=#{Geokit::Geocoders::google}&oe=utf-8" | |
res = Net::HTTP.get_response(URI.parse(url)) | |
puts res |
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 MockSuccess < Net::HTTPSuccess | |
def initialize | |
end | |
end | |
class MockFailure < Net::HTTPSuccess | |
def initialize | |
end | |
end |