Skip to content

Instantly share code, notes, and snippets.


Stephen Ball sdball

View GitHub Profile
sdball /
Created Dec 15, 2011
Quick demo of how to do a simple jQuery binding in CoffeeScript
$(document).ready ->
$('form').submit ->
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,
View gist:1218338
gem 'redis'
gem 'redis-store', '1.0.0.rc1'
View text_to_link.html
sdball / index.html
Created Jul 15, 2011
Use jQuery to modify URLs that contain a specific string
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Rewriting UR Links</title>
<h1>Rewriting UR Links</h1>
<a href="">Link to that opens in a new tab/window.</a>
View central_office_kml_example.xml
<name>Central Office</name>
<description>1049 N 3RD ST</description>
View typical_dsl_coverage_polygon.xml
sdball / usa_state_hash.rb
Created Jan 18, 2011
United States State Abbreviation Hash
View usa_state_hash.rb
@states = {
AL: "Alabama",
AK: "Alaska",
AZ: "Arizona",
AR: "Arkansas",
CA: "California",
CO: "Colorado",
CT: "Connecticut",
DE: "Delaware",
FL: "Florida",
sdball / googlemaps_loading_lots_of_points.js
Created Jan 1, 2011
A sampling of code for loading/unloading thousands of points as the user pans around the map.
View googlemaps_loading_lots_of_points.js
function requestMarkers() {
// no loading markers when zoomed way out
if (map.getZoom() < 11) { return };
// start dropping markers before the browser bogs down
if (markers.length > 50) {
// [snip typical ajax data request]
success: populateMarkers,
sdball /
Created Dec 13, 2010
Calculates arbitrary points in the fibonacci sequence using recursion. This is actually salesforce Apex code, not java.
// this is, obviously, just an apex exploration
// i.e. horribly inefficient
Integer fib(Integer n) {
if (n <= 1) return 1; else return fib(n-1) + fib(n-2);
for (Integer i=0; i<=12; i++) {