Skip to content

Instantly share code, notes, and snippets.

View dshaw's full-sized avatar
🦄
Always bet on Node.js ✨

Dan Shaw dshaw

🦄
Always bet on Node.js ✨
View GitHub Profile
http_simple (/bytes/1024) over 1-gbit network, with 700 concurrent connections:
------------------------------------------------------------------------------
windows-0.5.4 : 3869 r/s
windows-latest : 4990 r/s
linux-latest-legacy : 5215 r/s
linux-latest-uv : 4970 r/s
@dshaw
dshaw / gist:1212938
Created September 13, 2011 01:33 — forked from antirez/gist:1211737
How to add cmd-left-arrow and cmd-right-arrow (without shift) key bindings to the mac os x Terminal
app if the Lion install removed this bindings from your system.
1) Open "System Preferences".
2) Go to "Keyboard".
3) Select the "Keyboard Shortcuts" tab.
4) Select "Application Shortcuts" from the list of items in the left.
5) Press "+" to add a new shurtcut.
6) As "Application" select "Terminal", as "Menu Title" use: "Select Next Tab". For the "Keyboard Shortcut" field just select the field and press cmd-right-arrow.
7) Repeat again from step 5, using "Select Previous Tab" as Menu Title and pressing cmd-left-arrow as keyboard shortcut.
@dshaw
dshaw / index.html
Created September 21, 2011 21:05 — forked from 3rd-Eden/index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form id="chat">
<fieldset id="blabla">
</fieldset>
@dshaw
dshaw / Procfile
Created October 6, 2011 19:05 — forked from getify/browser-net-output.txt
trouble getting socket.io to work in node
web: node server.js
@dshaw
dshaw / HelloDartTest.dart
Created October 12, 2011 00:27
Dart Compilation
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// VMOptions=--compile_all
class HelloDartTest {
static testMain() {
print("Hello, Darter!");
@dshaw
dshaw / starttls.js
Created November 17, 2011 16:29 — forked from TooTallNate/starttls.js
Upgrade a regular `net.Stream` connection to a secure `tls` connection.
// Target API:
//
// var s = require('net').createStream(25, 'smtp.example.com');
// s.on('connect', function() {
// require('starttls')(s, options, function() {
// if (!s.authorized) {
// s.destroy();
// return;
// }
//
@dshaw
dshaw / gist:1408474
Created November 30, 2011 09:05 — forked from shripadk/gist:1406702
#!/usr/bin/env node
var os = require('os');
var WebSocketClient = require('websocket').client;
var count = 0;
function recursion() {
var client = new WebSocketClient();
client.on('connectFailed', function(error) {
@dshaw
dshaw / emitLines.js
Created February 10, 2012 01:24 — forked from TooTallNate/emitLines.js
Make any ReadableStream emit "line" events
/**
* A quick little thingy that takes a Stream instance and makes
* it emit 'line' events when a newline is encountered.
*
* Usage:
* ‾‾‾‾‾
* emitLines(process.stdin)
* process.stdin.resume()
* process.stdin.setEncoding('utf8')
* process.stdin.on('line', function (line) {
@dshaw
dshaw / package.json_private_module
Created July 26, 2012 03:20 — forked from mbrevoort/package.json_private_module
private npm repo namespace idea so that private registries don't have to replicate the entire public NPM registry or you don't have to do some sort of conditional proxying.
// A module published to a private registry would optionally have a "registry"
// property that is a reference to the registry where this module is published.
//
// A `npm publish` would publish to the registry in the registry property.
//
// Otherwise, `npm --registry http://private.me:5984/registry/_design/app/_rewrite publish`
//
{
"name": "foo",