Skip to content

Instantly share code, notes, and snippets.

@rogerallen
rogerallen / README.md
Last active August 29, 2015 14:15 — forked from mbostock/.block

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

Modified from Mbostock's original to use SVG transform/scale instead of re-deriving the area chart. Seems to be much faster in larger datasets.

// global variables
int top_x = 250;
int top_y = 150;
int cubert_move = 50;
int cubert_x = top_x;
int cubert_y = top_y;
float MOVE_TIME = 0.5;
float cubert_move_time = -1.0;
int cubert_start_x, cubert_start_y, cubert_end_x = top_x, cubert_end_y = top_y;
@rogerallen
rogerallen / stdout.txt
Last active August 29, 2015 14:02 — forked from fmasanori/jogos.py
readable world cup output
> ./wc.py
BRAZIL 3 x 1 croatia
MEXICO 1 x 0 cameroon
spain 1 x 5 NETHERLANDS
CHILE 3 x 1 australia
COLOMBIA 3 x 0 greece
IVORY COAST 2 x 1 japan
uruguay 1 x 3 COSTA RICA
england 1 x 2 ITALY
SWITZERLAND 2 x 1 ecuador
@rogerallen
rogerallen / ants.clj
Created September 15, 2013 15:29 — forked from michiakig/ants.clj
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;dimensions of square world