Skip to content

Instantly share code, notes, and snippets.

View hmalphettes's full-sized avatar

Hugues Malphettes hmalphettes

  • Standard Chartered Bank
  • Singapore
  • 00:15 (UTC +08:00)
View GitHub Profile
@hmalphettes
hmalphettes / bindings-cheat-sheet.md
Created June 3, 2016 09:15 — forked from eendeego/bindings-cheat-sheet.md
Node/V8 bindings cheat sheet
@hmalphettes
hmalphettes / pull-from-etcd.sh
Created March 9, 2016 04:08
push-to-etcd and pull-from-etcd
#!/bin/bash
# Pull from etcd the template files.
function download() {
mkdir -p "$1"
pushd "$1"
local files="$(etcdctl ls /stoic-etc/$1)"
for file in $files; do
local filename="$(basename $file)"
etcdctl get $file > $filename
@hmalphettes
hmalphettes / test-uuid-v5.js
Created July 20, 2014 08:27
Generate uuid-v5 in node
var expect = require('chai').expect;
var UUID = require('./uuid-v5');
describe('When generating a uuid v5', function() {
it('must generate the expected uuids from 3 examples on the web', function() {
var testUrl = UUID.v5(UUID.URL, 'www.example.org');
var testDns = UUID.v5(UUID.DNS, 'www.example.org');
var testDns2 = UUID.v5(UUID.DNS, 'php.net');
// see the examples here: http://jsfiddle.net/rexmac/F3pwA/
expect(testDns).to.equal('74738ff5-5367-5958-9aee-98fffdcd1876');
expect(testUrl).to.equal('abe19220-c90c-5288-b33a-58772250d428');