Skip to content

Instantly share code, notes, and snippets.

mbostock / .block
Last active Dec 9, 2016
Dispatching Events
View .block
license: gpl-3.0
dannguyen /
Last active Dec 17, 2016
Who Congress Follows on Twitter data

Find out who Congress follows on Twitter using the command line

Part of a lesson for the Stanford Journalism Computational Methods in the Civic Sphere

This is a short tutorial on how to use command-line tools, including csvfix and t, the command-line Twitter interface, to access and parse data from the Sunlight Foundation and Twitter. The end goal of this exercise is to gather who everyone in Congress follows (friends, in the parlance of Twitter), and then count up the common friends to find out which Twitter accounts are most followed by members of Congress.

Here's a screenshot of the result, after it's been imported into [Google Spreadsheets](

ramnathv / concaveman.R
Created May 2, 2017
Using Concaveman in R using V8
View concaveman.R
# Using concaveman in R using V8
concaveman <- function(d){
ctx <- v8()
jscode <- sprintf(
"var points = %s;var polygon = concaveman(points);",
jsonlite::toJSON(d, dataframe = 'values')
View wip-rendering.js
const regl = require('regl')({
extensions: 'OES_texture_float'
vec4 laplacian (sampler2D img, vec2 id, float DX) {
return -texture2D(img, id) + 0.25 * (
texture2D(img, id + DX * vec2(-1, 0))
+ texture2D(img, id + DX * vec2(1, 0))
+ texture2D(img, id + DX * vec2(0, -1))
View cubeflip.js
The MIT License (MIT)
Copyright (c) 2017 Eric Arnebäck
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
mbostock / .block
Last active Jun 17, 2017
View .block
license: gpl-3.0
mbostock / .block
Last active Sep 3, 2017
Concurrent Transitions
View .block
license: gpl-3.0
avibryant / loess.js
Created Aug 17, 2011
Loess smoothing
View loess.js
//adapted from the LoessInterpolator in org.apache.commons.math
function loess_pairs(pairs, bandwidth)
var xval ={return pair[0]});
var yval ={return pair[1]});
var res = loess(xval, yval, bandwidth);
return,i){return [x, res[i]]});
mbostock / .block
Last active Sep 12, 2018
TopoJSON Parallax
View .block
license: gpl-3.0
biovisualize / index.html
Last active Oct 15, 2018
D3.js Reusable Bar Chart with Angularjs
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
body {
font: 14px sans-serif;
.axis path, .axis line {
fill: none;