Skip to content

Instantly share code, notes, and snippets.

christophermanning / PHP 5.3 strlen.patch
Last active September 27, 2015 07:37
PHP 5.3 strlen
@@ -303,13 +300,14 @@
Get string length */
- zval **str;
+ char *s1;
+ int s1_len;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
christophermanning /
Last active November 22, 2022 22:14
Bitbucket Download Directory

Python script to download/shallow clone the files of a directory at bitbucket. This is useful when you just want a copy of the files in a subdirectory of a repository without needing mercurial or having to download the entire repository.

christophermanning / 50_top_paid_chicago_lobbyists.json
Last active April 2, 2022 21:28
Chicago Lobbyists Force-Directed Graph Visualization
christophermanning /
Last active September 29, 2015 18:57
Extract JSON from ChicagoLobbyists

Rudimentary method of extracting JSON data from the ChicagoLobbyists sinatra app for a force directed graph

christophermanning / README.mkd
Last active August 28, 2023 00:46
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning


Axle Eight Fibbobaci Florets [![Star]

christophermanning /
Last active March 30, 2023 04:24
Voronoi Diagram with Force Directed Nodes and Delaunay Links

Created by Christopher Manning


Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.


christophermanning /
Last active May 3, 2018 16:04
Chicago Ward Remap Outlines

Created by Christopher Manning


The wards in Chicago were recently remapped and I was mesmerized by the idea of creating an interaction that would animate the transition from the old to the new wards. I shortly found out that tweening polygons in a non-intersecting and interlocked fashion is a complicated topic. I've done a lot of reading about the math and research that has been done in this space and found a few interesting theories which I would like to implement in a future version. Currently, the morphing/tweening/interpolation is done with an array interpolator. Unfortunately, this technique causes the intermediate polygons to self-intersect and morph inefficiently. Ideally, I would overlay these polygons on a slippy map and there

christophermanning /
Created October 1, 2012 03:20 — forked from mbostock/.block
General Update Pattern, III

By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.

Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.

Want to read more? Try these tutorials: