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 Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var dataString = ['xxx', 'ssss', 'yyyyy', '1121212', 'aaaaa']; | |
var dataBuffer = [new Buffer('xxx'), new Buffer('ssss'), new Buffer('yyyyy'), new Buffer('1121212'), new Buffer('aaaaa')]; | |
suite.add('Buffer#copy', function() { | |
var offset = 0; | |
dataBuffer.forEach(function(chunk) { |
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
# npm install genji benchmark | |
var genji = require('genji'); | |
var Benchmark = require('benchmark'); | |
var Base = genji.Base; | |
var util = require('util'), | |
times = 500000; | |
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
/** | |
* Binary Parser. | |
* Jonas Raoni Soares Silva | |
* http://jsfromhell.com/classes/binary-parser [v1.0] | |
*/ | |
var chr = String.fromCharCode; | |
var maxBits = []; | |
for (var i = 0; i < 64; i++) { | |
maxBits[i] = Math.pow(2, i); |
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
/** | |
* Javascript OO helpers | |
*/ | |
/** | |
* Module exports. | |
*/ | |
exports.Base = Base; |
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
// Copyright 2011 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// Modify by linuz.ly | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"code.google.com/p/go.crypto/ssh" |
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
// Example folder object | |
{ | |
example_folder: { | |
type: "folder", | |
children: { | |
file1: { | |
type: "file", | |
blob: <Buffer 74 68 69 73 20 69 73 20 61 6e 20 65 78 61 6d 70 6c 65 20 66 69 6c 65> // this is a 10MB file | |
}, |
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
Step 1: From your project repository, bring in the changes and test. | |
git fetch origin | |
git checkout -b anton-redesign origin/anton-redesign | |
git merge master | |
Step 2: Merge the changes and update on GitHub. | |
git checkout master | |
git merge --no-ff anton-redesign | |
git push origin master |
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
$(function() { | |
var spaceKeyCode = 32; | |
//----------------------------------------- | |
var stream = require('dim')(); | |
var model = {}; | |
stream |
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 strict'; | |
module.exports = { | |
re: function(fnName, context) { | |
var fn; | |
context = context || this; | |
if ('function' === typeof fnName) { | |
fn = fnName; | |
fnName = fn.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; | |
} else { |
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
#!/bin/bash | |
# Mount the installer image | |
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
# Convert the boot image to a sparse bundle | |
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite | |
# Increase the sparse bundle capacity to accommodate the packages | |
hdiutil resize -size 8g /tmp/Yosemite.sparseimage |