Skip to content

Instantly share code, notes, and snippets.

View othiym23's full-sized avatar
💭
what is this thing you call, "architecture"

Forrest L Norvell othiym23

💭
what is this thing you call, "architecture"
  • Ellation / Crunchyroll / VRV
  • San Francisco
View GitHub Profile
var tap = require("tap")
var server = require("./lib/server.js")
var common = require("./lib/common.js")
tap.test("get returns 403", function (t) {
server.expect("/underscore", function (req, res) {
t.equal(req.method, "GET", "got expected method")
res.writeHead(403)
  • my job is to make npm the most useful tool it can be
  • to me, "useful" encompasses values:
    • pragmatism > rigor
      • people don't want their tools to surprise them
    • simplicity > completeness
      • do a few things well
      • let the community fill in the cracks
    • problems > solutions
      • developers love to skip over problems
  • having a clear understanding of several different problems often suggests an approach that will cover many or most of them
@othiym23
othiym23 / algo.md
Created August 15, 2014 22:28
stale locking v3
  1. acquire $lock, fail
  2. stat $lock, find that it is stale
  3. acquire $lock.STALE
  4. stat $lock, assert that it is still stale
  5. unlink $lock
  6. link $lock.STALE $lock
  7. unlink $lock.STALE
@othiym23
othiym23 / bam.js
Created August 15, 2014 21:47
lockfile tester
var resolve = require("path").resolve
var lock = require("lockfile").lock
var FILE = resolve(__dirname, "LOCKFILE")
var PID = process.pid
var OPTIONS = {retries : 0}
var SCALE = 16
var results = []
var running = SCALE

Use cases

  1. As npm, I want to safely put only valid metadata and tarballs into the npm cache.
  2. As npm, I want to ensure that multiple npms running concurrently don't download the same things repeatedly.

Requirements

  1. single-machine
  2. no native dependencies
  3. multi-process serialization for both reads and writes
@othiym23
othiym23 / skiffy.md
Created August 10, 2014 07:56
some sf and fantasy recommendations

The Winterlong Trilogy by Elizabeth Hand

Gothic, Grand Guignol-drenched post-apocalyptic science-fantasy. "Febrile" is a word that comes to mind – the language is overstuffed, it's dense with references to fantasy and folklore, and the characters are run through the wringer. Not the last of her novels to feature a transmogrified Washington DC as a primary venue.

Waking the Moon by Elizabeth Hand

Roman á clef and supernatural romance (in the traditional, not Twilight sense) featuring the hidden war between the Benandanti, a sect of nasty old patriarchal quasi-Catholics, and the forces of Othiym Lunarsa, goddess of a long-suppressed matriarchal death cult. If Camille Paglia ever read this, she probably loved it, but the central story is basically an overheated, fantastic version of Whit Stillman's Metropolitan and so th

@othiym23
othiym23 / .eslintrc
Created July 27, 2014 20:25
standard .eslintrc used for editing ASI-based npm modules
{
"env" : {
"node" : true
},
"rules" : {
"curly" : 0,
"no-lonely-if" : 1,
"no-mixed-requires" : 0,
"no-underscore-dangle" : 0,
"no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}],
@othiym23
othiym23 / 0-npm-cache-add-flow-before.txt
Last active August 29, 2015 14:02
the flow from one function to another within `npm cache add`
cache.add
-> maybeFile
-> addLocal
-> maybeAt
-o cache.add
-> addLocal
-> addRemoteTarball
-> addLocalTarball
-> addRemoteGit
-> addLocalTarball
Script started on Tue Jun 3 18:08:47 2014
% bauchelain% mmkdir ang2; cd ang2
% bauchelain% oo  yyo angular
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'

Hi, everyone, my name is Forrest Norvell, I’m a developer at npm, Inc., and I’m here to talk to you about the next version or two of JavaScript. I’m truly sorry that I’m what stands between you and lunch, but this is a talk I’ve wanted to give for a long time, and I hope you find it valuable.

I also compare you all to cows at least once in here, so that’s a thing.

ECMAScript 6, the standard that defines the next version of the JavaScript language, is probably going to be ratified towards the end of this year. It describes the most sweeping set of changes to the language in at least a