Skip to content

Instantly share code, notes, and snippets.

@Miserlou
Miserlou / cities.json
Created April 30, 2015 06:58
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@tmcw
tmcw / comprehensive_documentation.md
Created March 25, 2015 14:46
Comprehensive Documentation

Software is layered.

Documentation is not. If your documentation states

Run npm install foo to install this module

It is really saying

@ncase
ncase / GLOGS.md
Last active January 20, 2017 19:04
GLOGS

"Do and Show and Tell"

###Do & Show & Tell

Don't try to explain everything with something interactive. Use interactivity only when interactivity works best, otherwise, supplement it with text & images. Also keep in mind the overlaps of Do & Show & Tell: when text interacts with the diagrams (e.g. Tangle), and vice versa.

Text: Best at describing very abstract concepts.
Graphs: Best at showing broad relationships at a glance.
Animations: Best at showing temporal relationships.
Interactives: Best at showing processes, systems, models. (See final slide on Procedural Rhetoric)

@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

#To install:
#
#In your git configuration (for instance, .git/config to do it at the project level), add:
#
#[merge "json_merge"]
# name = A custom merge driver for json files
# driver = coffee json_merge.coffee %O %A %B
# recursive = binary
#
#In your project's .gitattributes file, add something like:
@yanofsky
yanofsky / jobsday_static_charts.sh
Created April 4, 2014 13:09
QZ Two simple charts script
#download the data and save it as json for the overview via a python script
cd overview
python overview_scraper.py
cd ../sector
#download the data and save it as json for the sector info via python script
python sector_scraper.py
cd ..
@timo22345
timo22345 / flatten.js
Last active March 13, 2024 17:06
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
@tonybruess
tonybruess / Username limitations for various services.txt
Last active March 10, 2024 13:23
Username limitations for various services
Skype
Min: 6
Max: 32
Can contain: a-z A-Z 0-9 . , _ -
Other: Must start with a letter
Twitter
Min: 1
Max: 15
Can contain: a-z A-Z 0-9 _
@gruber
gruber / make_bookmarklet.pl
Last active September 13, 2023 23:22
JavaScript Bookmarklet Builder
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR
@Rich-Harris
Rich-Harris / linearScale.js
Last active May 4, 2016 19:57
A simple linear scale function generator, similar to D3's
(function ( global ) {
'use strict';
var linearScale = function ( domain, range ) {
var d0 = domain[0], r0 = range[0], multiplier = ( range[1] - r0 ) / ( domain[1] - d0 );
// special case
if ( r0 === range[1] ) {
return function () {