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
info shasum 14348a29ca53db48a52495a0038d4b59585d4d2c
info shasum /tmp/npm-1328747591947/1328747592343-0.36824979027733207/tmp.tgz
silly updated sha bytes 40960
silly updated sha bytes 40960
silly updated sha bytes 40960
silly updated sha bytes 40960
silly updated sha bytes 40960
verbose mkdir (expected) error ENOENT, no such file or directory '/tmp/npm-1328747591947/1328747592343-0.36824979027733207/___package.npm'
silly updated sha bytes 40960
silly updated sha bytes 40960
@othiym23
othiym23 / gist:1819136
Created February 13, 2012 19:09
/usr/local/bin/mvim
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
@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
@othiym23
othiym23 / StreamBuffer.js
Created August 8, 2012 23:22
shove stuff in a Buffer, hand it to a callback when it's done
var events = require('events')
, util = require('util')
;
function StreamBuffer(callback) {
events.EventEmitter.call(this);
this.writable = true;
var self = this;
$ npm search asshole
npm http GET https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1341536947000
npm http 200 https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1341536947000
NAME DESCRIPTION AUTHOR DATE KEYWORDS
hipster Okay, so today I wrote a text editor in node.js and named it "hipster". Because I am an asshole. (and no one had already used the name for something more stupid) =dominictarr 2012-08-19 20:51
$ npm search fuck
npm http GET https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1341536947000
npm http 200 https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1341536947000
NAME DESCRIPTION AUTHOR DATE KEYWORDS
bf Interpret brainfuck in node.js. =jesusabdullah 2011-07-08 02:56
brainfuck A Brainfuck interpreter running on node.js =rajkissu 2011-07-24 14:12 brainfuck
fuck FUCK =random 2012-08-10 02:45
fugly-js Fucking ugly template engine =pablo 2011-12-26 19:49
hashlib lib for node which makes hashes =brainfucker 2011-07-25 22:25
lolqueue When you just need a fucking queue =apeace 2012-04-06 16:14
function Timer () {
this.hrStart = process.hrTime();
}
Timer.prototype.end = function () {
this.duration = process.hrTime(this.hrStart);
};
Timer.prototype.durationInMillis = function () {
return this.duration[0] * 1000 + this.duration[1] / 1000 / 1000;
@othiym23
othiym23 / node-stack-profile.d
Created October 9, 2012 00:36
32-bit base zone configuration
#!/usr/sbin/dtrace -s
profile-997
/execname == "node" && arg1/
{
@[jstack(40, 2000)] = count();
}
tick-30s
{
exit(0);
}
bauchelain% nvm use v0.6.19
Now using node v0.6.19
bauchelain% node --harmony
Error: unrecognized flag --harmony
Try --help for options
>
bauchelain% node --v8-options | grep harm
--harmony_typeof (enable harmony semantics for typeof)
--harmony_proxies (enable harmony proxies)
var domain = require('domain')
var d1 = domain.create();
var d2 = domain.create();
d1.on('error', function (error) { console.error('got error in outer domain') });
d2.on('error', function (error) { console.error('got error in inner domain') });
d1.run(function () {
process.nextTick(function () {
d2.run(function () {