Skip to content

Instantly share code, notes, and snippets.

View sreuter's full-sized avatar

Sascha Reuter sreuter

  • Atlassian
  • Sydney, Australia
View GitHub Profile
@sreuter
sreuter / gist:ac186eda2a83522a19b0bc9305a3db2b
Last active April 19, 2016 00:42
eval function expression vs. declaration in CouchJS/Spidermonkey
# CouchJS/Spidermonkey
$ echo "print(typeof eval('function (doc) { if(doc.type === "user") { emit(null, doc.name); } }'))" | ./couchjs -
function
$ echo "print(typeof eval('function yoo (doc) { if(doc.type === "user") { emit(null, doc.name); } }'))" | ./couchjs -
undefined
$ echo "print(typeof eval('(function (doc) { if(doc.type === "user") { emit(null, doc.name); } })'))" | ./couchjs -
function
@sreuter
sreuter / gist:8908293
Created February 10, 2014 00:31
Inject PFX-Certificate for SSL-Client-Authentication in cloudhead/cradle
/* Inject PFX-Certificate for SSL-Client-Authentication in cloudhead/cradle
*
* THIS REQUIRES A CURRENT VERSION OF CRADLE TO WORK!!!
*
*/
var pfx = fs.readFileSync('./cert.pfx');
// Inject PFX for SSL-Client-Authentication into cradle
cradle.connection.agent.options.pfx = cert;
@sreuter
sreuter / nodisco.js
Created January 18, 2013 14:54
Control the light setup at the doctape HACKATHON!
/*
* Clone artnet module from https://github.com/sreuter/artnet-node to make this work!
*/
var artnet = require('node-artnet/lib/artnet_client.js');
var Artnet = new artnet.createClient('172.16.3.255', 6454);
var data = [0,0,50,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
$ gpg --no-default-keyring --secret-keyring ./secring.gpg --passphrase-fd - --keyring ./pubring.gpg --edit-key 1234-1234-1234 passwd save <blubgpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
Reading passphrase from file descriptor 0
Secret key is available.
pub 2048R/0FB58FED created: 2011-03-06 expires: never usage: SCEA
trust: unknown validity: unknown