Skip to content

Instantly share code, notes, and snippets.

View cpdean's full-sized avatar

Conrad cpdean

View GitHub Profile
@cpdean
cpdean / README.md
Last active August 29, 2015 14:05
trying to show station inbalances

given the end-of-year data about which stations are feeding which, there're significant imbalances that require a manual rebalance by a given bikeshare program.

click and drag to pan, scroll to zoom.

trying to find the best way to visualize the imbalances for a single station before I extrapolate to every inter-station relationship.

@cpdean
cpdean / README.md
Last active August 29, 2015 14:05
plot bike stations

still work in progress...

Trying to get points from a CSV plotted on a map.

TODO:

  1. map flickers when you move it
  2. click-drag to pan moves slower than the mouse location
  3. I don't have any geo features to provide context (OSM streets?)
@cpdean
cpdean / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block

This is a fork of mike bostock's vector tiles example.

I've just re-centered it around Minneapolis to see how it looks.

Looking for an easy way to do map visualizations, geo data is too fickle to learn without leveraging tons of examples

Adapting d3.geo.tile to show OpenStreetMap vector tiles. See also the static example.

@cpdean
cpdean / doge.md
Last active November 21, 2021 08:51
YOU'RE WELCOME, INTERNET. -- if you search for an ascii doge, you don't get anything great that you can copy paste. found a silly gif (http://cmang.org/ascii/cm-doge-bw.gif) and i have transcribed it for all of you

no clue who made this, but ARTIST FOUND thank you @indyjoenz / cmang!

i have transcribed it here:

                Y.                      _   
                YiL                   .```.  
                Yii;                .; .;;`.    
                YY;ii._           .;`.;;;; :    
 iiYYYYYYiiiii;;;;i` ;;::;;;; 
import contextlib
def a_bad():
print "doing work"
raise IOError
def retry(n, f, e):
times = 0
@cpdean
cpdean / map_reduce_subquery_breaks.js
Last active August 29, 2015 13:56
q.js demo for having an arbitrary number of sub-promises generated from an initial promise
// @cpdean
// demonstrates how to have one promise kick off
// an additional arbitrary number of promises, and
// then merge their results down again after
// all the promises are complete.
var Q = require('q'); // "q": "~1.0.0"
// initial query that generates seed data for more work to be done
function fakeQuery(){
@cpdean
cpdean / map_reduce.js
Created January 27, 2014 23:36
q.js demo for merging the results of an arbitrary number of promises generated by an initial promise.
// @cpdean
// demonstrates how to have one promise kick off
// an additional arbitrary number of promises, and
// then merge their results down again after
// all the promises are complete.
var Q = require('q'); // "q": "~1.0.0"
// initial query that generates seed data for more work to be done
function fakeQuery(){
@cpdean
cpdean / README.markdown
Last active December 31, 2015 02:39
put CSS files next to this and find redundant rules. maybe you can use that to guide yourself in an OOCSS refactor

With the power of bash piping and a tiny python script you can see what css rules could stand to be merged into simple classes.

@cpdean
cpdean / SomeBolt.scala
Created December 3, 2013 03:03
Getting keywords out of a search
import com.example.util.Codec
import com.example.storm.bolts.IntervalBolt
import com.github.theon.uri.Uri.parseUri
class SomeBolt (serializer:Serializer, ticksBeforeFlush: Int, bufferLimit: Int)
extends IntervalBolt(ticksBeforeFlush) with Codec{
def bufferOffInterval(input: Tuple) = ???
def onInterval() = ???