Skip to content

Instantly share code, notes, and snippets.

View trevorbernard's full-sized avatar

Trevor Bernard trevorbernard

View GitHub Profile
@trevorbernard
trevorbernard / clojure.clj
Created July 31, 2013 02:49
Super simple way to send and receive Clojure data over ØMQ
(ns cljzmq-examples.serialization.clojure
(:require [clojure.edn :as edn]
[zeromq.zmq :as zmq]))
(defn send-clj
([socket clj-data]
(send-clj socket clj-data 0))
([socket clj-data flags]
(let [data (-> clj-data
(pr-str)
'''
An authentication module for pyzmq modelled on zauth from czmq.
The certificates used for CURVE authentication are assumed to be identical to
those generated by czmq.
'''
import glob
import json
import os
#!/bin/bash
function cleanTempDirectory() {
cd ~/tmp && rm -rf zeromq && mkdir zeromq && cd zeromq
}
function packageForDistribution() {
distrib="$1"
mkdir build_$distrib
cp --link *.tar.gz build_$distrib

Keybase proof

I hereby claim:

  • I am trevorbernard on github.
  • I am trevorbernard (https://keybase.io/trevorbernard) on keybase.
  • I have a public key whose fingerprint is 6A2F AF8B B1BC E8CA EBBF 0521 4051 0EB4 F61C 4C9E

To claim this, I am signing this object:

public class Example {
public static void main(String[] args) {
ZContext context = null;
try {
context = new ZContext();
new Application(args).start() // blocking call and will close it's resources when finished
} finally {
try { context.close() } catch( Exception e ) {}
}
}
@trevorbernard
trevorbernard / PushPullTest.java
Created November 22, 2014 22:01
Experimental ZeroMQ Socket API with Context automagically managed for you
package org.zeromq.zmq;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import org.junit.Test;
import static org.zeromq.zmq.ZMQ.*;
public class PushPullTest {
Verifying that +trevorbernard is my openname (Bitcoin username). https://onename.io/trevorbernard
package io.txb.eventstore;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org
hQEMA9+8P1iiiALAAQf+N0N45Rf896XSq3pMokBCiTOHKNojFpbvGEg/53Kj4u55
S9NQ6IvjLBe8gQRWjt9jHYBWouJky9pCnX3PzeoCCtpuTPP6QjfQejRR8UIJA7vG
mc74FJ584Riw7SbauTZYqYLJ/ZHxjDSrmHwm137HYuiZl8krpd0k9uqZImv5ReJT
SedlFMflbvrtE61nVHTD3621vysl8JPsb1rJiorbNpPFBj1RWdr8X9ihWCB6aiHF
LsZmcEgRlLKCo18OLHh62TFEhZFpASAw3rcv4ZqFlJ0rDGAm2bfAR0CqQ2crfVm7
N3JJnThBMMZKkmTfpEFbVjurxO0g2XU1zxlno2/oQNJgAU32qMIZFQetm+yKzAZe
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa