Skip to content

Instantly share code, notes, and snippets.

View jsvine's full-sized avatar

Jeremy Singer-Vine jsvine

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

An Open-Source Thank You

In late October, the WSJ published Waste Lands, an interactive database I helped build and report. Waste Lands draws upon thousands of public records and other sources to trace the history of hundreds of factories and laboratories the government recruited to help develop nuclear weapons during the build-up to the Cold War.

Building the database took considerable time and effort. But it would have been immeasurably more difficult and time-consuming — if not nearly impossible — without the fistfuls of open-source code we were able to rely upon:

@jsvine
jsvine / exemplify.js
Created November 13, 2013 22:33
A bare-bones helper for creating simple demos/tutorials. See example usage here: http://www.jsvine.com/gmap-button/demo/
var exemplify = function (fn, code_el) {
fn.call(fn);
var str = fn.toString();
var lines = str.split("\n").slice(1, -1);
var start_index = lines[0].match(/[^\s].*$/).index;
var trimmed = lines.map(function (x) {
return x.slice(start_index);
}).join("\n");
code_el.innerHTML = trimmed;
};
@jsvine
jsvine / rolling-average.js
Last active December 27, 2015 05:09
Just a little helper function. Depends on, and hooks into, underscore.
(function () {
var root = this;
var sum = function (arr) {
return _.reduce(arr, function (m, x) {
return m + x;
});
};
// n: Size of the stack, i.e., how far to look back
@jsvine
jsvine / exif.sh
Last active December 21, 2015 09:49
A ~/.bashrc one-liner I use almost daily. Provided the URL of an image, fetches the image's EXIF data.
exif () { curl -s "$1" | exiftool - ; }
###
#
# Add the line above to your ~/.bashrc file.
#
# Requires Phil Harvey's ExifTool: http://www.sno.phy.queensu.ca/~phil/exiftool/
#
# Usage example, for Aug. 20th's en.wikipedia.org featured picture:
#
@jsvine
jsvine / webscript-security-breach-email.md
Created November 7, 2012 18:16
"Potential Webscript security breach" email

from: Webscript Support support@webscript.io

date: Wed, Nov 7, 2012 at 12:54 PM

Subject: Potential Webscript security breach

Planet Rational's Amazon Web Services credentials have been inadvertently exposed, potentially leaking Webscript user data. (Planet Rational is the company behind Webscript.) While we don't know that any data was accessed, we do know that it was possible.

What we recommend

@jsvine
jsvine / _scam-js.md
Created November 5, 2012 16:10
Raspberry Ketone Javascript
@jsvine
jsvine / transcription.md
Created October 10, 2012 04:26
Frank Leslie A Life-Lengthener

Frank Leslie's Illustrated Newspaper — Dec. 15, 1860 — p. 53

(From the Home Journal)

FRANK LESLIE A LIFE-LENGTHENER.

By N.P. Willis

There are men who lengthen human life—those who shorten its industrial processes, or remove its hindrances or accelerate its compelled purposes and movements—enabling us to take ease and enjoy, where, before, we only lost life by toiling and suffering. It is for more time to live worthily, in fact, that we thank all great inventors—Morse for relieving us of suspense and dependence on mail-bags; Fulton for faster conveyance than by sails and stage-coaches; Whitney for a machine by which one man can do the work of three hundred; Hahnemann for enabling us to omit emetics and purges; Daguerre and Brady for superseding expensive portrait-sitting and difficult friend-remembering. And to this list of public benefactors we now think should be added Frank Leslie, who has rendered comparatively needless two of life's most laborious proceses, viz., the travelling and fancy-picturing

@jsvine
jsvine / draft.md
Created August 13, 2012 12:53
A Five-Borough Weekend

More than two years after moving to New York, I just had my first five-borough weekend. I full-throatedly recommend it. Much of the joy owed to letting the weekend develop organically; over-describing or -prescribing risks turning something fun into a checklist. But, in case you're simply curious, here's a synopsis:

Manhattan

It began inconspiculously. After work on Friday, I ambled down Sixth Avenue, having made what at the time felt like depressingly few weekend plans. I played and lost two chess games in Bryant Park at $1 apiece before deciding where to eat dinner: Phayul, a Tibetan restaurant that a friend and I had considered but decided against the previous weekend.

Queens

Phayul's location, a couple short blocks from the Roosevelt Ave. station in Queens's Jackson Heights neighborhood, makes it surprisingly accessible from midtown; I think the entire trip took less than a half-hour.

@jsvine
jsvine / README.md
Created June 13, 2012 13:40
Most-Requested gTLDs -- 12 Jan 2012 through 30 May 2012