Skip to content

Instantly share code, notes, and snippets.

@evanlucas
evanlucas / couchnode backtrace
Created June 20, 2016 17:53
couchnode backtrace
(lldb) bt
* thread #1: tid = 0, 0x00007f623f2905b9 couchbase_impl.node`on_flush_done(ctx=0x0000000004076720, expected=2543, actual=2543) + 56 at mcserver.c:84, name = 'node', stop reason = signal SIGSEGV
* frame #0: 0x00007f623f2905b9 couchbase_impl.node`on_flush_done(ctx=0x0000000004076720, expected=2543, actual=2543) + 56 at mcserver.c:84
frame #1: 0x00007f623f2cfce8 couchbase_impl.node`Cw_ex_handler(sd=0x0000000004019ca0, status=0, wdata=0x00000000000009ef) + 68 at ctx.c:527
frame #2: 0x00007f623f28fbb5 couchbase_impl.node`write2_callback(req=0x0000000004035e30, status=0) + 95 at plugin-libuv.c:383
frame #3: 0x0000000001b0f9e4 node`uv__write_callbacks(stream=0x0000000004019cf8) + 328 at stream.c:940
frame #4: 0x0000000001b0e7e9 node`uv__stream_destroy(stream=0x0000000004019cf8) + 312 at stream.c:450
frame #5: 0x0000000001b019f5 node`uv__finish_close(handle=0x0000000004019cf8) + 145 at core.c:256
frame #6: 0x0000000001b01af9 node`uv__run_closing_handles(loop=0x000000000285c3e0)
  • [fe4837afcc] - handle_wrap: IsRefed() -> HasRef() (Jeremiah Senkpiel) #6546
  • [96a9439fd2] - Revert "handle_wrap: IsRefed -> Unrefed, no isAlive check" (Jeremiah Senkpiel) #6546
  • [428240519c] - test: check that 2nd handle.close() call is a nop (Ben Noordhuis) #6395
  • [a58d4839af] - src: simplify handlewrap state tracking logic (Ben Noordhuis) #6395
  • [cad1a62d32] - src: use libuv's refcounting directly (Ben Noordhuis) #6395
  • [9bb5a5e2a1] - **hand
'.source.js':
'test':
'prefix': 'test'
'body': 'test(\'${1:name}\', (t) => {\n $2\n})'
'inspect':
'prefix': 'inspect'
'body': 'console.log(require(\'util\').inspect(${1:var}, {\n colors: true\n, depth: null\n}))'
'proto':
'prefix': 'proto'
'body': 'prototype.${2:fn} = function ${2}() {\n \n}'
@evanlucas
evanlucas / notes.md
Created April 28, 2016 15:34
npm publish index.js issue
../node_modules/nan/nan.h:602:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:608:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:613:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:619:20: error: no type named 'GCPrologueCallback' in 'v8::Isolate'

repl

  • _ holds the result of the last expression. Now, it is possible to assign a variable to _. Although, this will disable the behavior of holding the last expression.
  • Improvements have been made that decrease the number of errors when completion fails
  • Ref: 6328

dns

[Docs]

  • dns.resolve() now supports resolving plain DNS PTR records. Previously, calling dns.resolve(hostname, 'PTR', cb) would call dns.reverse() on the hostname. That is no longer the case. One must now pass the hostname as a reverse IN-ADDR domain.

Before:

$ telnet github.com 9418
0031git-upload-pack /nodejs/node\0host=github.com\0

Gitlab CI Code Coverage with node-tap

  1. Set the 'Test coverage parsing' to ^Statements\s*:\s*([^%]+)
  2. In your .gitlab-ci.yml file, run tap with the --coverage-report=text-summary flag
function isAvailable(username, email, isAvailableCallback) {
pool.getConnection(function(err, connection, poolCallback) {
if (err) {
return isAvailableCallback(err)
}
// you can call both callbacks in here
poolCallback()
})