Skip to content

Instantly share code, notes, and snippets.

View mhkeller's full-sized avatar

Michael Keller mhkeller

View GitHub Profile
@mhkeller
mhkeller / gist:5938408
Created July 6, 2013 02:40
backbone example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>crazy-julian-shit</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script>
<style type="text/css" media="screen">
.stateViews {
@mhkeller
mhkeller / gist:5957704
Created July 9, 2013 14:19
Common rich text characters
´’”“–
@mhkeller
mhkeller / README.md
Last active March 24, 2016 14:08
D3 + Leaflet.js making div markers from GeoJSON

This is a work in progress. Based off of the polygon svg example here: http://bost.ocks.org/mike/leaflet/

Built to find a way around the difficulty in manipulating markers in leaflet / adding arbitrary html / classes / ids etc. to better time them to some time of user-driven narrative (buttons, scrolling etc.)

--tell application "iOS Simulator" to activate
tell application "System Events"
set visible_apps to application processes whose visible is true
repeat with app_ in visible_apps
if name of app_ is "iOS Simulator" then
set visible of app_ to true
end if
end repeat
end tell
@mhkeller
mhkeller / gist:6044119
Created July 20, 2013 06:57
table_schemer
var _ = require('underscore'),
$ = require('jquery'),
fs = require('fs');
var table_names = {
't1': "t1: Operating Cash Balance",
't2': "t2: Deposits and Withdrawals",
't3a': "t3a: Public Debt Transactions",
't3b': "t3b: Adjustment of Public Debt Transactions",
't3c': "t3c: Debt Subject to Limit",
var collectionFactoryHelpers = {
empty_arr: [],
createCollectionOfModels: function(model, arr_of_objects){
var arr = _.clone(this.empty_arr);
arr_of_objects.forEach( function(item){
arr.push( new model(item) );
});
return arr;
}
};
@mhkeller
mhkeller / gist:6199171
Created August 10, 2013 05:19
nesting a collection in a model
http://jsfiddle.net/mhkeller/cJMmv/2/
http://slashhashbang.com/2011/10/lightweight-relation-modeling-with-backbone/
@mhkeller
mhkeller / gist:6308076
Created August 22, 2013 14:39
CMS Safe External Links
<script src="//s3.amazonaws.com/newsbeastlabs.thedailybeast.com/2013/gtmo-force-feeding/libs/underscore-min.js"></script>
<!DOCTYPE html>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 10px sans-serif;
}
rect {
@mhkeller
mhkeller / instructions.md
Last active December 21, 2015 21:09
Useful Raspberry Pi setup links