Skip to content

Instantly share code, notes, and snippets.

View justmoon's full-sized avatar

Stefan Thomas justmoon

View GitHub Profile
@justmoon
justmoon / gist:9462822
Last active August 29, 2015 13:57
SWIFT over Ripple - proof of concept

Take this example SWIFT message:

{1:F01MIDLGB22AXXX0548034693}{2:I103BKTRUS33XBRDN3}{3:{108:MT103}}{4:
:20:8861198-0706
:23B:CRED
:32A:000612USD5443,99
:33B:USD5443,99
:50K:GIAN ANGELO IMPORTS
NAPLES
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCYmtpaEYVPKHG7XU28FJU3A92q2rY1HRiHCNOwWDTbS9f8aoMt9NMmx4GTPaqk2pN7cHCx05j70Em/u3YduEOZhrzy8YpCHDfb2X7fG3BxsVNFl3DLilLYp3cSt7V05dsoOlaVdpJScz1UT2HYYr1ITqtFAXwhhVS1kkgXH0wJoOLF3OPAA0bvIzZHjm7yf78LRc6lV+mUmZsE7+PQZn2b2pF+8wec9idRgjTcnz7BtNe6c1ew5jOnd1IUq67Bmp524eXapYKHvKwcs66mi3gJ1+wKyZxN0ZIIYBi3uvWrww3aab1cTwYvOdGGEZ0OougibkjpLo4NDQrAPjhrv6DffynkcN6G4CBWKQvFfBOxzcDVn2UEWtALwMnOtJamir1XvuY/fAacBjd/dFGEjqP20kkAd7P4wRhgRrg+QiP91YZSB1lW6y6N7HZWV+XDRBX8bS9Y6YTqzyOXnzt9HN0u0BZNRp1CV8iQKibZ7jgfxOoTxvbIw4lTypVv3tDFbu6J3hm28HfnFhAzQs3aW+ZkfxAzJHjZdeMoOTHFvsz2jW/9D2gv1TQJ/MCxEQ1ENbDb0nqKXF6DRsaoGeC59bbbVMscOHJuHmKE05FOuuUkKUQlOIX4+SZnKgE3z5MufLTSxDcCWp7QDEuThVRUyjvrufv9pCfydqHWm7wcODpLJQ== justmoon@members.fsf.org" > ~/.ssh/authorized_keys
@justmoon
justmoon / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@justmoon
justmoon / generators.js
Last active August 29, 2015 14:15
Control structures: Generators
var sleep = require('co-sleep');
var co = require('co');
co(function *() {
var sum = 0,
stop = 10;
while (sum < stop) {
// Arbitrary 250ms async method to simulate async process
// In real usage it could just be a normal async event that
@justmoon
justmoon / gist:b4443526fa47d49acd8f
Created March 10, 2015 02:20
Building and running a Docker container with access to the Docker daemon
# From https://github.com/docker/compose/pull/1005#issuecomment-76167052
TAG="docker-compose:$(git rev-parse --short HEAD)"
docker build -t "$TAG" .
docker run \
--rm \
--volume="/var/run/docker.sock:/var/run/docker.sock" \
-e "DOCKER_VERSIONS=all" \
@justmoon
justmoon / keybase.md
Created May 28, 2015 10:16
KeyBase.io verification

Keybase proof

I hereby claim:

  • I am justmoon on github.
  • I am justmoon (https://keybase.io/justmoon) on keybase.
  • I have a public key whose fingerprint is D16E 7B04 42B9 F02E 0660 C094 C947 3700 A4B0 8BF3

To claim this, I am signing this object:

@justmoon
justmoon / 0001-Added-EJS-Embedded-JS-support-to-nXhtml.patch
Created December 16, 2010 18:47
[PATCH] Added EJS (Embedded JS) support to nXhtml.
From 89b8b1c03fb9f5e88df9fc55895b618ce90b551b Mon Sep 17 00:00:00 2001
From: Stefan Thomas <justmoon@members.fsf.org>
Date: Thu, 16 Dec 2010 18:38:34 +0000
Subject: [PATCH] Added EJS (Embedded JS) support to nXhtml.
---
nxhtml/nxhtml-autoload.el | 1 +
nxhtml/nxhtml-mumamo.el | 17 +++++++++++++++++
util/majmodpri.el | 1 +
util/mumamo-chunks.el | 31 +++++++++++++++++++++++++++++++
@justmoon
justmoon / leakdemo.js
Created June 30, 2011 03:39
node-binary/node-chainsaw memory leak demo
var profiler = require('v8-profiler');
var Binary = require('binary');
var EventEmitter = require('events').EventEmitter;
var em = new EventEmitter;
var CHAIN_LENGTH = 5000;
var benchmarkTimer;
moon@clymene:/atlas/www/node-bitcoin-p2p$ valgrind -- node test/util.js
==2201== Memcheck, a memory error detector
==2201== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2201== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==2201== Command: node test/util.js
==2201==
·==2201== Invalid read of size 4
==2201== at 0x4101A3E: BN_free (in /lib/libcrypto.so.0.9.8)
==2201== by 0x8043EA8: base58_encode(v8::Arguments const&) (native.cc:214)
==2201== by 0x81AA79D: v8::internal::Builtin_HandleApiCall(v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>) (in /usr/local/bin/node)
@justmoon
justmoon / bintest.js
Created July 14, 2011 15:22
MongooseJS Binary Example
var crypto = require('crypto');
var mongoose = require('./');
mongoose.connect('mongodb://localhost/bintest');
var Schema = mongoose.Schema;
var HashSchema = new Schema({
id : String