Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🗽
✊ Fist in the air in the land of hypocrisy

Charlie Robbins indexzero

🗽
✊ Fist in the air in the land of hypocrisy
View GitHub Profile
if (req.url~ "^/[^/]+/-/[^/]+\.tgz") {
set req.url = regsub(req.url, "^/([^/]+)/-/([^/]+\.tgz)", "/isaacs/public/npm/$1/_attachments/$2");
} else {
set req.url = "/isaacs/public/npm/" req.url "/doc.json";
}

build

Clone and build Node for analysis:

$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1"
$ ./configure
$ make -j4
@SaneMethod
SaneMethod / jquery-ajax-blob-arraybuffer.js
Last active November 29, 2024 17:59
Ajax transports to allow the sending/receiving of blobs and array buffers via the familiar jquery ajax function.To send, set data to the blob or arraybuffer to be sent, and add 'processData:false' to the ajax options.To receive, specify the 'dataType' as blob or arraybuffer in the ajax options.
(function($){
/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
@mikeal
mikeal / gist:6685843
Last active December 23, 2015 19:58
Response to comments by Issac Roth of StrongLoop

This is rather out of date and we've all moved past it. Me and Issac are cool now.

pic

@caged
caged / d3-server.js
Last active October 17, 2023 04:05
Directly render and serve d3 visualizations from a nodejs server.
// Start `node d3-server.js`
// Then visit http://localhost:1337/
//
var d3 = require('d3'),
http = require('http')
http.createServer(function (req, res) {
// Chrome automatically sends a requests for favicons
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't
// fixed or this is a regression.
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active June 25, 2025 15:36
5 entertaining things you can find with the GitHub Search API
@isaacs
isaacs / npmswitch-example.log
Last active December 18, 2015 09:39
This is how I change people's packages over to a different username in npm. It requires admin powers, of course, unless you're doing it with your own username.
$ curl http://registry.npmjs.org/-/by-user/testuser
{"testuser":["npm-test-blerg","npm-test-publish"]}
$ curl http://registry.npmjs.org/-/by-user/testuser2
{}
$ npmswitch testuser testuser2
+ npm cache clean npm-test-blerg
+ npm owner add testuser2 npm-test-blerg
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:testuser2
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active January 13, 2026 12:45
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@rwaldron
rwaldron / response.md
Last active December 15, 2015 14:28
This is in response to Peter van der Zee's blog post, http://qfox.nl/weblog/282

Peter van der Zee published this post on his personal blog and it was featured in this week's edition of JavaScript Weekly. The following sections each contain a piece of code copied directly from his post, followed by an irrefutable explanation of why it is either wrong or misleading.

EDIT, April 1, 2013: I've removed any harsh language, but the content and corrections remain the same.

These are facts.

Computed properties...

From: Sam Stephenson <[email protected]>
Subject: Re: ruby-build hint
Date: Sun, 10 Feb 2013 12:25:56 -0600
To: Michał Papis <[email protected]>
Hi Michał,
Thanks for the email.
You're right that `[[` is not POSIX sh-compliant. Nor are the following