This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter | |
var i; | |
var count = 100000000; | |
var e = new EventEmitter(); | |
e.on('hi', function() {}); | |
now = Date.now(); | |
for (i = 0; i < count; i++) { | |
e.emit('hi'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var domain = require('domain'); | |
var i, now, count = 10000000; | |
var source = domain.Domain.toString(); | |
now = Date.now(); | |
for (i = 0; i < count; i++) { | |
domain.create(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Readable = require('stream').Readable; | |
var i, now, count = 1000000; | |
var source = Readable.toString().split('\n')[9]; | |
now = Date.now(); | |
for (i = 0; i < count; i++) { | |
new Readable(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var tls = require('tls'); | |
var i, now, count = 10000000; | |
var port = 10443, host = 'localhost', options = {}; | |
var agent = new https.Agent(); | |
// stub function | |
tls.connect = function() {}; | |
now = Date.now(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'activerecord', '4.0.0.beta1', require: 'active_record' | |
gem 'enumerize', github: 'brainspec/enumerize' | |
gem 'sqlite3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> | |
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.0.0/ember.js"></script> | |
</head> | |
<script type="text/x-handlebars"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require("sys"); | |
var express = require("express"); | |
// see http://github.com/redsquirrel/simple_pusher | |
var simple_pusher = require(__dirname + "/lib/simple_pusher"); | |
var GraphData = require(__dirname + "/qa_data").GraphData; | |
var graphData = new GraphData(["yes", "little", "no"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var now; | |
var fn, i; | |
var count = 10000000; | |
now = Date.now(); | |
fn = function() { | |
arguments[0]; | |
} | |
for (i = 0; i < count; i++) { | |
fn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see: http://gimite.net/gimite/rubymess/moji.html | |
var zenkaku = /(?:[ !”#$%&’()*+,-./:;<=>?@[¥]^_‘{|} ̄])|(?:[、。・゛゜´`¨ヽヾゝゞ〃仝々〆〇ー―‐\~〜∥…‥“〔〕〈〉《》「」『』【】±×÷≠≦≧∞∴♂♀°′″℃¢£§☆★○●◎◇◇◆□■△▲▽▼※〒→←↑↓〓])|(?:[0-9])|(?:[A-Z])|(?:[a-z])|(?:[ぁ-ん])|(?:[ァ-ヶ])|(?:[Α-Ωα-ω])|(?:[А-Яа-я])|(?:[\u2570-\u25ff])|(?:[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff])/; | |
var hankaku = /(?:[\x00-\x1f\x7f])|(?:[ !"#$%&'()*+,\-.\/:;<=>?@\[\\\]\^_`{|}~])|(?:[\uFF61\uFF62\uFF63\uFF64\uFF70\uFF9E\uFF9F\uFF65])|(?:[0-9])|(?:[A-Z])|(?:[a-z])|(?:[\uFF66-\uFF6F\uFF71-\uFF9D])/; |