Skip to content

Instantly share code, notes, and snippets.


Stephen Ball sdball

View GitHub Profile
sdball / broadbandmap.jquery.js
Created Nov 18, 2011 jquery javascript plugin
View broadbandmap.jquery.js
(function( $ ){
var settings = {
lat: 38.651198,
lng: -97.976074,
address: '',
minimumDetailZoom: 4,
defaultZoom: 4,
displayLitBuildings: false,
displayCentralOffices: false,
dslHeatmapActive: false,
sdball /
Created Dec 15, 2011
Quick demo of how to do a simple jQuery binding in CoffeeScript
$(document).ready ->
$('form').submit ->
sdball /
Created Aug 8, 2012
Expand URLs by following a single redirect
main() {
if [ -z $1 ]; then
echo "Usage: expand-url URL"
exit 1
response $url | parse_redirect
sdball / autobots.bash
Created Sep 18, 2012
beanstalkd rollout!
View autobots.bash
$ ruby rollout.rb
$ stalk jobs.rb
sdball / Gemfile
Last active Dec 10, 2015
Just a quick prototype to talk to's sandbox.
View Gemfile
# Ruby 1.8.7
source ""
gem "json_pure"
group :test do
gem "rspec"
gem "vcr"
gem "webmock"
sdball / fiat_nil.rb
Last active Dec 10, 2015
Don't Do What Johnny Don't Does
View fiat_nil.rb
class FiatNil
def method_missing(*args)
sdball /
Created Jan 18, 2013
Rules for good development from Sandi Metz

Sandi Metz’ rules for developers

  1. Your class can be no longer than a hundred lines of code.
  2. Your methods can be no longer than five lines of code
  3. You can pass no more than four parameters and you can't just make it one big hash.
  4. In your controller, you can only instantiate one object, to do whatever it is that needs to be done.
  5. Your view can only know about one instance variable.
  6. Your Rails view should only send messages to that object i.e., no Demeter violations.[ "thunder dome principal". Translated: one model in, one model out! ]
  7. Rules are meant to be broken if by breaking them you produce better code. [ ...where "better code" is validated by explaining why you want to break the rule to someone else. ]
sdball / deploy.rb
Created Jan 23, 2013
Example capistrano task to confirm deployment
View deploy.rb
# drop this task in the environment(s) you want to confirm deployment for
before :deploy, "deploy:confirm"
namespace :deploy do
desc "Should we really deploy?"
task :confirm do
if Capistrano::CLI.ui.ask("Are you sure?") == "yes"
puts "You got it buddy. Imma deploy now."