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
@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@othiym23
othiym23 / ca-store-generator.js
Last active August 21, 2023 14:42
Hacky script to download Mozilla's root CA store and turn it into a bundle suitable for use with Node TLS.
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var request = require('request');
var CERTDB_URL =
'https://mxr.mozilla.org/nss/source/lib/ckfw/builtins/certdata.txt?raw=1';
var OUTFILE = './certificates.js';
@othiym23
othiym23 / cascadiajs-2014-continuation-local-storage.md
Created July 12, 2019 19:29
CascadiaJS 2014: Continuation Local Storage (CLS) slides

[fit] constantly losing stuff

lessons learned developing and using continuation-local-storage in Node

Forrest L Norvell, npm, Inc.

ponytime othiym23 on npm / GitHub / Twitter

^ code-heavy talk that focuses on Node; some interesting pieces for the front end towards the end


@othiym23
othiym23 / gist:3050224
Created July 5, 2012 00:10
Getting SmartOS working under vmware

If you prefer VirtualBox or aren't running OS X, here are some instructions and a script to help you get started with SmartOS under VirtualBox. If you use VirtualBox, skip the first section and read the section on how to get the Node.js SmartMachine up and running.

Running SmartOS under vmware Fusion

  1. Start by downloading the latest live image
  2. When you run the new VM wizard, select "Continue without disk" on the first screen of the wizard.
  3. Select Sun Solaris / Solaris 10 64-bit on the next screen.
  4. You're going to get dumped to a config screen when the live image starts up, choose DHCP for the networking and defaults for everything else.
  5. Pretty much the first thing you're going to want to do is figure out how to SSH into the box once it boots and creates its storage pools, because trying to do stuff in the virtual console is miserable. There's no cut and paste

The Node.js group is a tool to announce cool things you've built, discuss cool things you're working on, and get help with things that are confusing you. It is a great forum for swapping knowledge. It is part of Node's large, loose network of resources. But it's not the only one – there are other resources that might be a better place to seek help or ask questions:

  • Stack Overflow is a great place to get help with specific technical questions about Node! If you post a question there, please wait a few days before crossposting it to the list, as many of the people who answer questions about Node on SO are also here. Also, crosspost with a link rather than the whole text of the question, to keep things tidy and to keep discussion of the issue in one place.
  • The development of Node itself is largely handled through Github. If you think you've encountered a bug in Node itself, it's best to file an issue there.
  • L

arm64 build notes

Google really wants anything arm-related to be cross-compiled instead of built on the ARM device. A pity, because @groundwater found a really awesome and cheap service that rents out 96-core arm64 servers.

The current Electron build infrastructure is designed to make it quick for end-user developers to put together their apps. Many pieces that are built at the same time are packaged separately,

UNINCORPORATED FACTS

  • _tickCallback processes the process.nextCallback queue
  • setTimeout cannot have a timeout smaller than 1
  • domains make changes

Understanding the Node event loop

There are two important things to remember about the Node event loop. The

@othiym23
othiym23 / prover.js
Last active May 22, 2018 04:06
Simple proof-of-work server for Node.js.
'use strict';
/* To test:
* echo -n <input> | nc localhost 1337
*
* Results are <input>:<nonce>
*
* Passing e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e should get back
* e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e:2c8
*/
const assert = require('assert')
module.exports = solve
const RIGHT = Symbol('RIGHT')
const UP = Symbol('UP')
const LEFT = Symbol('LEFT')
const DOWN = Symbol('DOWN')
function generate (turn) {
@othiym23
othiym23 / wtf.md
Last active September 10, 2017 03:35
An experiment. Subject to change.