Skip to content

Instantly share code, notes, and snippets.

@evanlucas
evanlucas / gist:16fc21c141841e0724c3
Last active August 29, 2015 14:22
allow node -ie
commit 09e46c3d48d9c81daa68e4dc69a249fa80b3287f
Author: Evan Lucas <[email protected]>
Date: Mon Jun 1 10:17:19 2015 -0500
allow -ie
diff --git a/src/node.js b/src/node.js
index 2516478..d370ce0 100644
--- a/src/node.js
+++ b/src/node.js
@evanlucas
evanlucas / highlights-line-numbering.css
Created June 2, 2015 22:55
atom highlights with line numbering
.editor {
counter-reset: linenumber;
font-size: 16px;
font-family: Monaco;
}
.editor > .line {
counter-increment: linenumber;
}
[~/dev/code/forks/WORK-io.js]
:] ➜ $ node -pe "require('internal/repl')" (master)
{ createInternalRepl: [Function: createRepl] }
[~/dev/code/forks/WORK-io.js]
:] ➜ $ node (master)
> require('internal/repl')
{ createInternalRepl: [Function: createRepl] }
> ⏎
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js
index 6d1c22d..6155f9a 100644
--- a/lib/internal/child_process.js
+++ b/lib/internal/child_process.js
@@ -271,6 +271,10 @@ ChildProcess.prototype.spawn = function(options) {
this.spawnfile = options.file;
this.spawnargs = options.args;
+ console.log(require('util').inspect(options, {
+ colors: true,
@evanlucas
evanlucas / gist:4738a8848ffa1e94f358
Created September 7, 2015 21:04
Runtime_NumberToInteger
node`v8::internal::Runtime_NumberToInteger:
node[0x100551f20] <+0>: pushq %rbp
node[0x100551f21] <+1>: movq %rsp, %rbp
node[0x100551f24] <+4>: pushq %r15
node[0x100551f26] <+6>: pushq %r14
node[0x100551f28] <+8>: pushq %r12
node[0x100551f2a] <+10>: pushq %rbx
node[0x100551f2b] <+11>: movq %rdx, %rbx
node[0x100551f2e] <+14>: movq 0x6b78(%rbx), %r15
node[0x100551f35] <+21>: movq 0x6b80(%rbx), %r14
Process 10089 launched: './out/Release/node' (x86_64)
start
Process 10089 stopped
* thread #1: tid = 0x679c0f, 0x000000010015e4ff node`v8::Value::IntegerValue(this=<unavailable>, context=<unavailable>) const + 415 at api.cc:3272, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x000000010015e4ff node`v8::Value::IntegerValue(this=<unavailable>, context=<unavailable>) const + 415 at api.cc:3272
3269 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(int64_t);
3270 }
3271 return Just(num->IsSmi() ? static_cast<int64_t>(i::Smi::cast(*num)->value())
-> 3272 : static_cast<int64_t>(num->Number()));
3273 }
start
Process 10116 stopped
* thread #1: tid = 0x680998, 0x00000001006ac2e6 node`node::ProcessWrap::ParseStdioOptions(node::Environment*, v8::Local<v8::Object>, uv_process_options_s*) [inlined] node::Environment::isolate_data(this=0x0000000101803000) const at env-inl.h:374, queue = 'com.apple.main-thread', stop reason = breakpoint 1.2
frame #0: 0x00000001006ac2e6 node`node::ProcessWrap::ParseStdioOptions(node::Environment*, v8::Local<v8::Object>, uv_process_options_s*) [inlined] node::Environment::isolate_data(this=0x0000000101803000) const at env-inl.h:374
371 }
372
373 inline Environment::IsolateData* Environment::isolate_data() const {
-> 374 return isolate_data_;
375 }
376
/usr/bin/python tools/gyp_node.py -f make
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/dev/io.js/out'
g++ -I../deps/gtest -I../deps/gtest/include -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/ubuntu/dev/io.js/out/Release/.deps//home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o.d.raw -c -o /home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o ../deps/gtest/src/gtest-death-test.cc
g++ -I../deps/gtest -I../deps/gtest/include -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /home/ubuntu/dev/io.js/out/Release/.deps//home/ubuntu/dev/io.js/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o.d.raw -c -o /home/ubuntu/de
@evanlucas
evanlucas / noexit.js
Created October 23, 2015 20:12
noexit.js
process.on('uncaughtException', function(err) {
throw err
})
process.on('exit', function() {
console.log('exit')
})
throw new Error('fdsaf')
@evanlucas
evanlucas / arrows.js
Created October 27, 2015 01:14
arrows.js
'use strict'
module.exports = Client
function Client() {
this.name = 'client'
}
Client.prototype.run = function run(cb) {
const n = 'server'