Skip to content

Instantly share code, notes, and snippets.

kosamari /
Created Jun 15, 2015
What I learned from reading PRs and issues on 'What is Code?' repo

Programmers likes to fix things. When there is a typo in your code, then your code won't work. There are many requests to fix typo in the article from inconstant numbering in footnotes to wrong filename for images. When spotting someone's mistake, get creative and title your PR like "Instagram is only worth 1 Instragram not 2 Instragrams". Programmer's attention to detail extends not only the article itself, but also the license doc in the repo.

Don't forget to fact check before spotting mistake though. It's important. Keyword to use is AFAIK and can confirm.

Programmers love to know the source of information. There are few requests to add hyperlinks to contents referenced in the article. Some are from original autho

jsermeno / perspectiveProject.js
Created Jun 5, 2011
Three.js Transform 3D coordinates to screen coordinates and back in perspective projection -
View perspectiveProject.js
projector = new THREE.Projector(),
p3D = new THREE.Vector3(25, 15, 9),
p2D = projector.projectVector(p3D, camera);
p3D = projector.unprojectVector(p2D, camera);
Rich-Harris / linearScale.js
Last active May 4, 2016
A simple linear scale function generator, similar to D3's
View linearScale.js
(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 () {
tmcw /
Created Mar 25, 2015
Comprehensive Documentation

Software is layered.

Documentation is not. If your documentation states

Run npm install foo to install this module

It is really saying


"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)

mbostock / .block
Last active Aug 27, 2017 — forked from dustin/index.html
Text Along a Path
View .block
license: gpl-3.0

Clojure is for Aristotelians

I was reading ["Clojure is for Type B Personalities"][2] and it sparked some thoughts I had about the intersection of western philosophy and programming.

One could say Mathematics is an extension of Epistemology. And all theory about computability are an extension of mathematics. I reckon how one thinks about computability and how one writes computable functions are a reflection of a person's natural epistemological tendencies. This is going to be just as unscientific as ["Clojure is for Type B Personalities"][2], but hopefully another

yanofsky /
Created Apr 4, 2014
QZ Two simple charts script
#download the data and save it as json for the overview via a python script
cd overview
cd ../sector
#download the data and save it as json for the sector info via python script
cd ..
soemarko / theme.html
Created Nov 26, 2011
embed github gist to tumblr
View theme.html
<!-- Add the following lines to theme's html code right before </head> -->
<script src=""></script>
<script src=""></script>
<script src=""></script>
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist"></div>
elaineo /
Last active Mar 16, 2019
Turn podcasts into Twitter threads
from TwitterAPI import TwitterAPI
import json
import logging
import time
from collections import OrderedDict
from random import random
Assume 3 participants. You will need to create a Twitter account for each participant, and get API keys for each one.