Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Oberstein oberstet

View GitHub Profile
View py
(python279_1)oberstet@thinkpad-t430s:~/scm/crossbar/crossbarexamples/containers/failures$ make
crossbar start --cbdir=./working/.crossbar
2015-08-28T14:46:36+0200 [Controller 21216] __ __ __ __ __ __ __ __
2015-08-28T14:46:36+0200 [Controller 21216] / `|__)/ \/__`/__`|__) /\ |__) |/ \
2015-08-28T14:46:36+0200 [Controller 21216] \__,| \\__/.__/.__/|__)/~~\| \. |\__/
2015-08-28T14:46:36+0200 [Controller 21216]
2015-08-28T14:46:36+0200 [Controller 21216] Version: 0.11.0
2015-08-28T14:46:36+0200 [Controller 21216]
2015-08-28T14:46:36+0200 [Controller 21216] Starting from node directory /home/oberstet/scm/crossbar/crossbarexamples/containers/failures/working/.crossbar
2015-08-28T14:46:37+0200 [Controller 21216] Loading node configuration file '/home/oberstet/scm/crossbar/crossbarexamples/containers/failures/working/.crossbar/config.json'
View gist:8738339
$ make install
npm install websocket
...
npm install when
...
$ cat foo.js
var websocket = require('websocket');
console.log(websocket);
View gist:9526275
from autobahn.asyncio.websocket import WebSocketServerProtocol, \
WebSocketServerFactory
import asyncio
import json
def fastsquare(x):
return x * x
View gist:9526288
<!doctype html>
<html>
<body>
<script>
function carre(){
ws = new WebSocket("ws://127.0.0.1:9000");
ws.onopen = function(){
console.log("Connection is open...");
// Web Socket is connected, send data using send()
View gist:9564253
/**
* POJO for Activity JSON objects.
*/
public final static class Activity {
public String id;
public String label;
public Date created;
public Date modified;
public boolean is_visible;
View gist:9731827
#include <iostream>
#include <string>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#include <boost/thread/future.hpp>
using namespace boost;
View gist:9749964
oberstet@vbox-ubuntu1310:~/scm/AutobahnCpp$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
clang++ -o build/test/test8 -stdlib=libc++ -pthread build/test/test8.o -L/home/oberstet/boost_1_55_0/stage/lib -L/home/oberstet/msgpack_clang/lib -lboost_thread -lboost_system
scons: done building targets.
oberstet@vbox-ubuntu1310:~/scm/AutobahnCpp$ ./build/test/test8
done:
^C
oberstet@vbox-ubuntu1310:~/scm/AutobahnCpp$ ldd ./build/test/test8
View gist:9773483
auto f = session.call("com.mathservice.add2", {7, 33});
f.then([](decltype(f) res) {
cerr << "Result: " << any_cast<uint64_t>(res.get()) << endl;
});
View gist:9785088
#include <iostream>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
int main() {
View gist:9783309
#include <iostream>
#define BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#include <boost/thread/future.hpp>
using namespace boost;
int main() {