Skip to content

Instantly share code, notes, and snippets.

View watson's full-sized avatar

Thomas Watson watson

View GitHub Profile
View print-leaked-events.js
'use strict'
const asyncHooks = require('async_hooks')
const asyncIds = new Set()
const asyncHook = asyncHooks.createHook({
init (asyncId, type, triggerAsyncId, resource) {
const eid = asyncHooks.executionAsyncId()
process._rawDebug(`${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}`, resource)
watson / install-redis.ps1
Last active January 23, 2018 09:59 — forked from FeodorFitsner/install-redis.ps1
Install Redis
View install-redis.ps1
Write-Host "Downloading Redis..." -ForegroundColor Cyan
$redisRoot = "$env:SYSTEMDRIVE\Redis"
$zipPath = "$($env:USERPROFILE)\"
(New-Object Net.WebClient).DownloadFile('', $zipPath)
7z x $zipPath -y -o"$redisRoot" | Out-Null
del $zipPath
Write-Host "Installing Redis as a Windows service..."
& "$redisRoot\redis-server.exe" --service-install
View same-tick-ondata-oldmode.js
var stream = require('stream')
var rs = new stream.Readable()
rs._read = function() {}
var sameTick = true
rs.on('data', function() {