Skip to content

Instantly share code, notes, and snippets.

View curlup's full-sized avatar

Pavel T curlup

  • Knowledge Systems @ DFCI
View GitHub Profile
year pov_level income_deficit
1992 33.5 5.9
1993 31.5 5.3
1994 22.4 3.3
1995 24.7 3.8
1996 22 3.1
1997 20.7 2.8
1998 23.3 3.5
1999 28.3 4.8
2000 29 5
@curlup
curlup / README.md
Last active August 29, 2015 14:03 — forked from mbostock/.block

A spanning tree of the canvas is generated using Prim’s algorithm and then flooded with color. Hue encodes Manhattan distance from the root of the tree. (This is not an optimal visual encoding, but it suffices and is pretty.)

Spanning trees can also be used to generate mazes. See a maze generated with Prim’s algorithm flooded with color, and compare color floods of spanning trees generated with Prim’s algorithm to random traversal, randomized depth-first traversal and Wilson’s algorithm.

@curlup
curlup / README.md
Last active August 29, 2015 14:03 — forked from mbostock/.block
""""
The orignal author: Alexer / #python.fi
"""
import opcode
import dis
import sys
import multiprocessing
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@curlup
curlup / query_profile.py
Created October 5, 2015 10:44 — forked from amorton/query_profile.py
Tool for profiling Cassandra query performance.
"""Tool for profiling Cassandra query performance.
Tests are run by profile() multiple times and the 'Read Latency' is
extracted using node tool.
Usage:
#Create the schema using the cassandra-cli.
create keyspace query
@curlup
curlup / gist:2920364
Created June 12, 2012 21:53
Eratosthenes
def filterer(k, DEBUG = False):
def g():
x = 1; m = yield;
while True:
m = yield (m if x<=k or x%k != 0 else 0)
x += 1
g = g()
g.next()
def _debug_filterer(x):
res = map(g.send, x)
@curlup
curlup / gist:3229682
Created August 1, 2012 18:40
monik http agent config ex
def status_conf(port):
return {
'name': 'frontikd_{0}'.format(port),
'response_processor': 'regexp',
'url': 'http://127.0.0.1:{0}/status/'.format(port),
'metrics': {
'served': (r'pages served: (\d+)', 'COUNTER'),
'http-calls': (r'http reqs made: (\d+)', 'COUNTER'),
}
}
@curlup
curlup / gist:3370381
Created August 16, 2012 14:12
график релизов по командам
#!/usr/bin/env python
#coding: utf-8
import calendar, datetime, time, itertools
from itertools import cycle, starmap
class ReleaseCal(calendar.HTMLCalendar):
def __init__(self, groups, offset=0, skip_list=None):
super(ReleaseCal, self).__init__()
self.skip_list = skip_list if skip_list is not None else []
@curlup
curlup / README.md
Created November 12, 2013 16:38 — forked from mbostock/.block

The first 15 seconds of the D3 show reel. See full video at http://vimeo.com/29862153. Includes seamless transitions between the following visualization types:

  • lines
  • horizons
  • areas
  • stacked areas
  • streamgraph
  • overlapping areas
  • grouped bars
  • stacked bars