Skip to content

Instantly share code, notes, and snippets.

View ralphtheninja's full-sized avatar
🏠
Working from home

ralphtheninja

🏠
Working from home
View GitHub Profile
function eachUser(user) {
// Suchabfrage starten
graphabfrage.get(user.id, function(err, res) {
if (err) console.log('FEHLER updatelocationids: '.JSON.stringify(err));
dblocations.findOne({ id: user.id }, function (err, fbitem2){
// bla bla ..
})
})
}
info 55eH BLOB want "fVK+Kj5bsern84huziv5rrkS8kxWl7bNbsOVafLpxjc=.blake2s"
info 55eH BLOB want "h2f3ZPEEJzPE+GtDw69nzwZegicmT1wzu11GaekzU3o=.blake2s"
info 55eH BLOB want "StsqwisMOOmT3RYvnkF3hT1u6ph4Dg6ProD8PR1xczM=.blake2s"
info 55eH BLOB got "/ZrDz5KILJSmJ/BMyt2KTR8bc8vNXLMZAQaoRSdWvbY=.blake2s"
info 55eH AUTH 14 req "55eHs2t9xT9hAQ3ln5PueRXllrxZIVhGhtCP2bL/IY0=.blake2s"
info 55eH REMO 14 remote-authed {"granted":true,"type":"client","role":"master"}
info 55eH SBOT 14 client-authed "55eHs2t9xT9hAQ3ln5PueRXllrxZIVhGhtCP2bL/IY0=.blake2s"
info 55eH BLOB 64FmNkolarZeXMldJAKwj9E54XwXJdubIqD1sPPCgCQ=.blake2s downloading
"3VMW9RnPpmRp4T0F3lOoYJkVKuesSS7nipNJchNLT70=.blake2s"
@ralphtheninja
ralphtheninja / data.json
Last active August 29, 2015 14:15
calling rpc.add on data
{
"type": "sys-stat",
"text": {
"os": {
"type": "Linux",
"arch": "x64",
"platform": "linux",
"loadavg": [0.41845703125,0.587890625,0.6923828125]
},
"process": {
// This uses level-sublevel to separate data from ttl meta data
// into different sublevels
var crypto = require('crypto')
var level = require('level')
var sublevel = require('level-sublevel')
var ttl = require('level-ttl')
var rmrf = require('rimraf')
var path = './duuuude_db'

Effective transpiling of ES6

After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.

I refrained from including these details on the original post because they're subject to inmiment obsoletion. The tools are changing and evolving quickly, and some of this knowledge is likely to become outdated in the coming months or even weeks.

The tool

When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. It features:

@ralphtheninja
ralphtheninja / runner.js
Created March 4, 2015 14:02
simple script for running a command until it breaks
#!/usr/bin/env node
var spawn = require('child_process').spawn
var argv = process.argv.slice(2)
if (argv.length === 0) {
console.log('missing command')
}
var cmd = argv[0]
@ralphtheninja
ralphtheninja / http.js
Last active August 29, 2015 14:16
lasercat-workshop
var http = require('http')
var server = http.createServer()
var io = require('socket.io')(server)
board.on('ready', function () {
// ..
})
server.listen(9582)
var test = require('tape');
var bytewise = require('bytewise');
var encode = bytewise.encode;
var MIN = bytewise.MIN;
var MAX = bytewise.MAX;
test('tuple queries', function (t) {
var yearly = tuples('reports', 'yearly');
// component keys of the tuple space query are available by index
@ralphtheninja
ralphtheninja / mdb.md
Last active August 29, 2015 14:17 — forked from tjfontaine/mdb.md

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

initscript="
start on started networking
stop on stopping networking
respawn
env HOME='/root'
exec wiki -f -p 80
"