Skip to content

Instantly share code, notes, and snippets.

'use strict';
const common = require('../common');
const assert = require('assert');
const os = require('os');
process.on('SIGINT', common.mustCall());
process.on('SIGTERM', common.mustCall());
process.kill(process.pid, 'SIGINT');
@evanlucas
evanlucas / _helpers.tpl
Last active September 26, 2017 00:05
k8s template examples
{{/*
Renders all urls as env variables. This is done so adding new
service-to-service talk doesn't require a template change
so Values.urls.member_service_url will be rendered as MEMBER_SERVICE_URL
env var. :p
*/}}
{{- define "env.urls" -}}
{{- range $key, $val := .Values.urls -}}
{{ $env_name := $key | upper }}
- name: {{ $env_name }}
:] (v8.4.0) ➜ kubectl get pods --sort-by='.metadata.creationTimestamp'
error: unknown type *api.Pod, expected unstructured in map[reflect.Type]*printers.handlerEntry{}
Statistical profiling result from isolate-0x102801600-v8.log, (10566 ticks, 77 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
18 0.2% /usr/lib/system/libsystem_platform.dylib
16 0.2% /usr/lib/system/libsystem_malloc.dylib
16 0.2% /usr/lib/system/libsystem_kernel.dylib
3 0.0% /usr/lib/system/libsystem_c.dylib
2 0.0% /usr/lib/system/libsystem_pthread.dylib
Statistical profiling result from isolate-0x102801600-v8.log, (16715 ticks, 737 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
73 0.4% /usr/lib/system/libsystem_platform.dylib
43 0.3% /usr/lib/system/libsystem_malloc.dylib
18 0.1% /usr/lib/system/libsystem_kernel.dylib
2 0.0% /usr/lib/system/libsystem_c.dylib
1 0.0% /usr/lib/system/libsystem_pthread.dylib
[optimizing 0x8384b6db121 <JS Function removeSocket (SharedFunctionInfo 0x2cc2131fd799)> - took 0.576, 1.317, 0.223 ms]
[completed optimizing 0x8384b6db121 <JS Function removeSocket (SharedFunctionInfo 0x2cc2131fd799)>]
[deoptimizing (DEOPT eager): begin 0x8384b6db121 <JS Function removeSocket (SharedFunctionInfo 0x2cc2131fd799)> (opt #169) @20, FP to SP delta: 152, caller sp: 0x7fff5fbfe8c0]
;;; deoptimize at <_http_agent.js:283:33>, not a heap number
reading input frame removeSocket => node=144, args=3, height=7; inputs:
0: 0x8384b6db121 ; [fp - 16] 0x8384b6db121 <JS Function removeSocket (SharedFunctionInfo 0x2cc2131fd799)>
1: 0x3e582021eb91 ; r12 0x3e582021eb91 <an Agent with map 0x1104d7c39259>
2: 0x9cd00239a09 ; r9 0x9cd00239a09 <a Socket with map 0x1104d7c4ca21>
3: 0x9cd002395e1 ; [fp + 16] 0x9cd002395e1 <an Object with map 0x1104d7c4b739>
4: 0x27cfb8bf951 ; r8 0x27cfb8bf951 <FixedArray[5]>
Traceback (most recent call last):
File "tools/test.py", line 1700, in <module>
sys.exit(Main())
File "tools/test.py", line 1674, in Main
if RunTestCases(cases_to_run, options.progress, options.j, options.flaky_tests):
File "tools/test.py", line 905, in RunTestCases
return progress.Run(tasks)
File "tools/test.py", line 107, in Run
self.RunSingle(False, 0)
File "tools/test.py", line 141, in RunSingle
@evanlucas
evanlucas / node_crypto.diff
Last active December 9, 2016 17:38
allow buffers for crypto.randomBytes
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 8f2f750..8912eea 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -5503,14 +5503,21 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
ERR_error_string_n(req->error(), errmsg, sizeof errmsg);
argv[0] = Exception::Error(OneByteString(req->env()->isolate(), errmsg));
- argv[1] = Null(req->env()->isolate());
req->release();
@evanlucas
evanlucas / change.sh
Created December 1, 2016 15:25
change git remote url
$ git config remote.origin.url [email protected]/<USERNAME>/node
@evanlucas
evanlucas / gist:0425899c3b9907f180a5006970b3cca6
Created August 3, 2016 17:21
core-validate-commit: tap output
$ core-validate-commit https://api.github.com/repos/nodejs/node/pulls/7961/commits -t --no-validate-metadata
TAP version 13
# Subtest: f8976389e8e75055cdb41bf52755861e39829663
ok 1 - fixes-url: skipping fixes-url # SKIP
ok 2 - line-length: line-lengths are valid
ok 3 - subsystem: valid subsystems [benchmark]
ok 4 - title-length: Title is <= 50 columns.
1..4
ok 1 - f8976389e8e75055cdb41bf52755861e39829663 # time=2.685ms