This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
from sqlalchemy import text | |
logger = logging.getLogger(__name__) | |
class PGEventBus: | |
def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"caret_style": "wide", | |
"color_scheme": "Packages/User/SublimeLinter/One Dark (Flake8Lint) (SL).tmTheme", | |
"enable_tab_scrolling": false, | |
"ensure_newline_at_eof_on_save": true, | |
"fold_buttons": false, | |
"font_size": 14, | |
"ignored_packages": | |
[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def main_loop(): | |
req = await get_request() | |
msg = req["msg"] | |
await db.insert(msg) | |
await post("https://parse.com/...", msg) | |
return Response("Ok") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from fabric.api import * | |
CWD=os.path.basename(os.getcwd()) | |
def deploy(bot=CWD): | |
with cd("/home/stepan/%s" % bot): | |
run("git pull") | |
run("git submodule update") | |
sudo("systemctl restart %s" % bot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def progress(perc): | |
bar = "\r[{0:<50}] {1}%".format("=" * int(perc/2), perc) | |
sys.stdout.write(bar) | |
sys.stdout.flush() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nodebox.graphics import * | |
from math import sin, pi | |
class Vis(object): | |
def __init__(self): | |
self.t = 0 | |
self.s = 8 | |
self.color = Color(77, 77, 255, 200, base=255) | |
def draw(self, canvas): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nodebox.graphics import * | |
from random import randint, choice, uniform | |
SIZE = (1280, 720) | |
class Circle(object): | |
def __init__(self): | |
self.x = randint(0, SIZE[0]) | |
self.y = randint(0, SIZE[1]) | |
self.color = [255, 204, 34, randint(20, 150)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function | |
from nodebox.graphics import * | |
from random import randint, getrandbits, uniform | |
from collections import deque | |
SIZE = (1280, 800) | |
LAYERS = 20 | |
STARS_COLOR = Color(189, 155, 0, 255, base=255) | |
WINDOWS_COLOR = Color(189, 155, 0, 255, base=255) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nodebox.graphics import * | |
from random import randint, choice, uniform | |
SIZE = (1280, 720) | |
class Circle(object): | |
def __init__(self): | |
self.x = randint(0, SIZE[0]) | |
self.y = randint(0, SIZE[1]) | |
self.color = [255, 204, 34, randint(20, 150)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zmq = require('../../') | |
, sock = zmq.socket('push'); | |
sock.bindSync('tcp://127.0.0.1:5556'); | |
setInterval(function(){ | |
console.log('sending pub'); | |
sock.send('10001 some pub'); | |
}, 500); |