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
make -C out BUILDTYPE=Release V=1 | |
LD_LIBRARY_PATH=/Users/Soarez/src/joyent/node/out/Release/lib.host:/Users/Soarez/src/joyent/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /Users/Soarez/src/joyent/node/out/Release/obj/gen; python tools/js2c.py "/Users/Soarez/src/joyent/node/out/Release/obj/gen/node_natives.h" src/node.js lib/_debugger.js lib/_linklist.js lib/assert.js lib/buffer.js lib/buffer_ieee754.js lib/child_process.js lib/console.js lib/constants.js lib/crypto.js lib/cluster.js lib/dgram.js lib/dns.js lib/domain.js lib/events.js lib/freelist.js lib/fs.js lib/http.js lib/https.js lib/module.js lib/net.js lib/os.js lib/path.js lib/punycode.js lib/querystring.js lib/readline.js lib/repl.js lib/stream.js lib/string_decoder.js lib/sys.js lib/timers.js lib/tls.js lib/tty.js lib/url.js lib/util.js lib/vm.js lib/zlib.js ./config.gypi src/macros.py | |
c++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_DARWIN_USE_64_BIT_INODE=1' '-DNODE_WANT_INTERNALS=1' '-DARCH="x64 |
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
//Question: | |
// Environment: NodeJS | |
// Lets suppose that you have a collection of items, and your function must persist all items using the | |
//database.insert(item, callback ) function. When you finish the task, you should call the callback function. | |
// If one item raise a error, the callback(err) must be called and never call the callback anymore. | |
function noop() {} |
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 util = require('util'); | |
var EventEmitter = require('events').EventEmitter; | |
function Spy(f, ctx) { | |
var ee = new EventEmitter(); | |
spy.called = false; | |
Object.keys(EventEmitter.prototype).forEach(function(p) { | |
spy[p] = transfer; |
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
program: main.c | |
gcc -Wall -O0 -masm=intel -m32 -g -o program main.c |
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 | |
contents=`ls` | |
module_names=() | |
module_folders=() | |
npm_root=$(npm root -g) | |
do_pull=1 | |
do_npm_install=1 | |
do_npm_link=1 |
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 Transform = require('stream').Transform; | |
var util = require('util'); | |
module.exports = LineTransform; | |
util.inherits(LineTransform, Transform); | |
function LineTransform() { | |
Transform.apply(this, arguments); | |
this.setEncoding('utf8'); | |
} |
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
const net = require('net'); | |
const fs = require('fs'); | |
var req = fs.readFileSync('./req.txt', { encoding: 'utf8' }); | |
var socket = new net.Socket(); | |
socket.connect(7001, '127.0.0.1', function() { | |
console.log('Connected'); | |
var c = 50000; | |
while (c --> 0) |
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 | |
set -e | |
#node="/home/vagrant/nodes/iojs-v1.6.2-linux-x64/bin/iojs" | |
node="/home/vagrant/nodes/node-v0.12.1-linux-x64/bin/node" | |
node_flags='--perf_basic_prof' | |
script='/home/vagrant/porf/single.js' | |
script_log=/dev/null | |
# load_generator="node test.js" |
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
# List rules | |
sudo iptables -t nat -L | |
# Add rule to forward 80 to 3080 | |
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080 | |
# Will delete all rules from nat table | |
sudo iptables -F -t nat |
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 | |
function deploy { | |
# Update the rsync target on the server | |
rsync \ | |
-av \ | |
--delete \ | |
--delete-excluded \ | |
$rsync_ignore_list_param \ | |
$rsync_source/ $target:$rsync_target |