Skip to content

Instantly share code, notes, and snippets.

View sanderpick's full-sized avatar
🎟️
Got me a ticket to ride

Sander Pick sanderpick

🎟️
Got me a ticket to ride
View GitHub Profile
sudo touch /usr/local/var/log/mongodb/output.log
sudo mongod --fork --logpath /usr/local/var/log/mongodb/output.log
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
source ~/.git-completion.bash
export CLICOLOR='true'
export PS1='\[\033[1;35m\]\u\[\033[0m\]:\[\033[1;35m\]\W\[\033[0m\] \[\033[1;92m\]$(__git_ps1 "(%s)")\[\033[0m\]\$ '
export PATH=/usr/local/bin:$PATH
# {{{
# Node Completion - Auto-generated, do not touch.
shopt -s progcomp
#!/bin/bash
# Disclaimer:
# We are not actively maintaining this script. We can't assure it will work, but we'll do our best to keep it updated.
# Credits:
# Original author: https://gist.github.com/lbosque/5876697
# Contributors:
# https://gist.github.com/andrewxhill/5884845 Mac-compatible version
# https://gist.github.com/kentr / http://maplight.org/ new uuid format bugfix + email notification
# https://gist.github.com/sanderpick/185bc819c6a80b06d1b8 allow spaces in filesnames
@sanderpick
sanderpick / index.html
Last active August 29, 2015 14:16
Torque Heatmap w/ GM API is all black
<!DOCTYPE html>
<html>
<head>
<title>Torque Heatmap w/ GMA</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<link rel="shortcut icon" href="Icons/favicon.ico" />
<style>
html, body, #map-canvas {
@sanderpick
sanderpick / index.html
Created March 2, 2015 19:34
Torque Heatmap w/ Leaflet
<!DOCTYPE html>
<html>
<head>
<title>Torque Heatmap w/ GMA</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<link rel="shortcut icon" href="Icons/favicon.ico" />
<style>
html, body, #map-canvas {
@sanderpick
sanderpick / trigger.sql
Last active August 29, 2015 14:17
TRIGGER: clear old data on INSERT
CREATE OR REPLACE FUNCTION clearOld()
RETURNS TRIGGER
AS $$
BEGIN
DELETE FROM sf_muni_points WHERE created_at < now()-'1 day'::interval;
RETURN NEW;
END;
$$ language plpgsql;
CREATE TRIGGER clearOldOnInsert
@sanderpick
sanderpick / distance.sql
Created March 24, 2015 13:31
ST_Length + ST_MakeLine: connect the dots and measure distance
SELECT
ST_Length(ST_MakeLine(the_geom_webmercator ORDER BY created_at ASC)) AS sum
FROM sf_muni
WHERE id = '2'
@sanderpick
sanderpick / gist:1249306
Created September 28, 2011 21:27
main.js
window._ = require('underscore');
window.Step = require('step');
window.DNode = require('dnode');
requirejs(['libs/json2',
'libs/modernizr-1.7.min',
'libs/backbone-min',
'libs/store.min'],
function () {
window.App = {
@sanderpick
sanderpick / gist:4073812
Created November 14, 2012 18:21
mol row result view
/*
* Search Result view
*/
define([
// dependencies
'jQuery',
'Underscore',
'views/boiler',
'text!/templates/rows/result.html',