Skip to content

Instantly share code, notes, and snippets.

View joshcurtis's full-sized avatar
🍪

Josh Curtis joshcurtis

🍪
View GitHub Profile

Keybase proof

I hereby claim:

  • I am joshcurtis on github.
  • I am joshkurtis (https://keybase.io/joshkurtis) on keybase.
  • I have a public key ASBi2WbvVSgzJ6V93amMfDCFZEf_0wvsuJxy7BdOMx22FAo

To claim this, I am signing this object:

@joshcurtis
joshcurtis / bad_port.py
Created April 26, 2016 17:59
python doesn't exit after sending data to nonopen port
import zmq
print "Starting"
context = zmq.Context()
dealer = context.socket(zmq.DEALER)
hostname = 'tcp://localhost:11111'
dealer.connect(hostname)
dealer.send_string("Why don't I exit?")
print "Why don't I exit!!!"
raise RuntimeError("Free me!!! I am the prisoner of the interpretor")
var mt = require('machinetalk-protobuf');
var zmq = require('zmq')
var messageContainer = {
type: mt.message.ContainerType.MT_PING
};
var msg = mt.message.Container.encode(messageContainer);
var buffer = msg.buffer.slice(0, msg.limit)
var reply = mt.message.Container.decode(msg);
@joshcurtis
joshcurtis / gist:9f3e09cd179551c8619f
Last active December 4, 2015 08:44
Is it possible to store a vec and an iterator over that vec in a struct?
Struct S {
let v: Vec<objects>
let iter: // ?????????
}
Impl S {
fn init(&mut self) {
v = getObjects()
iter = v.something() // ?????????
}