Skip to content

Instantly share code, notes, and snippets.

View jgupta's full-sized avatar

Jai Gupta jgupta

View GitHub Profile
# https://github.com/squeaky-pl/portable-pypy
wget https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.4.1-linux_x86_64-portable.tar.bz2
tar -xf pypy-5.4.1-linux_x86_64-portable.tar.bz2
mv pypy-5.4.1-linux_x86_64-portable /opt
ln -s /opt/pypy-5.4.1-linux_x86_64-portable/bin/pypy /usr/local/bin/
ln -s /opt/pypy-5.4.1-linux_x86_64-portable/bin/virtualenv-pypy /usr/local/bin/
rm pypy-5.4.1-linux_x86_64-portable.tar.bz2
pypy --version
wget https://bootstrap.pypa.io/get-pip.py
pypy get-pip.py
@jgupta
jgupta / pub.php
Created August 9, 2012 21:48
pub.php
<?php
$context = new ZMQContext(1);
// Socket to talk to clients
$responder = new ZMQSocket($context, ZMQ::SOCKET_PUB);
$responder->bind("tcp://127.0.0.1:5555");
while(true) {
$responder->send("hello there");
@jgupta
jgupta / sub.php
Created August 9, 2012 21:48
sub.php
<?php
$context = new ZMQContext();
// Socket to talk to server
$subscriber = new ZMQSocket($context, ZMQ::SOCKET_SUB);
$subscriber->connect("tcp://127.0.0.1:5555");
$subscriber->setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, 'hello');
$subscriber->setSockOpt(ZMQ::SOCKOPT_HWM, 10);