Skip to content

Instantly share code, notes, and snippets.

View FZambia's full-sized avatar

Alexander Emelin FZambia

View GitHub Profile
@FZambia
FZambia / rich_output.ipynb
Created September 9, 2014 20:26
rich_output.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FZambia
FZambia / run_other_languages.ipynb
Created September 9, 2014 20:27
run_other_languages.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FZambia
FZambia / system_calls.ipynb
Created September 9, 2014 20:28
system_calls.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FZambia
FZambia / altere.go
Last active August 29, 2015 14:08
Alterportal.ru filter by comment count
package main
import (
"fmt"
"html/template"
"io/ioutil"
"log"
"net/http"
"strconv"
"strings"
@FZambia
FZambia / session.py
Created November 20, 2014 18:31
SockJS ws ping pong
class BaseSession(object):
def _heartbeat(self):
"""Heartbeat callback"""
if self.handler is not None:
if self.server.settings.get('ws_ping_pong', False) and hasattr(self.handler, 'ping'):
self.handler.ping(proto.HEARTBEAT)
else:
self.handler.send_pack(proto.HEARTBEAT)
else:
self.stop_heartbeat()
@FZambia
FZambia / centrifuge_plus_tornado.py
Created January 22, 2015 20:17
centrifuge_plus_tornado
import tornado.ioloop
import tornado.web
from centrifuge.node import create_centrifuge_application
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
@FZambia
FZambia / centrifuge_api_json.py
Created February 2, 2015 21:51
Send data to Centrifuge as JSON (coming soon)
# coding: utf-8
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, Request
try:
from urllib import urlencode
except ImportError:
# python 3
@FZambia
FZambia / centrifuge.nginx.conf
Created May 6, 2015 19:58
centrifuge nginx conf
upstream centrifuge {
# Enumerate all the Tornado servers here
#sticky;
ip_hash;
server 127.0.0.1:8000;
#server 127.0.0.1:8001;
}
map $http_upgrade $connection_upgrade {
default upgrade;
@FZambia
FZambia / compare.md
Last active August 29, 2015 14:27
go1.4 vs go1.5 for Centrifugo

GO 1.4

GOMAXPROCS=2

MacAir:benchmarks fz$ go run benchmark.go ws://localhost:8000/connection/websocket development secret 4000 1000 50
1440097030
max clients: 4000
increment: 1000
@FZambia
FZambia / tuning.md
Last active September 1, 2015 10:22
Tuning Centrifuge and Centrifugo