(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # -*- coding: utf-8 -*- | |
| import os | |
| import errno | |
| import itertools | |
| import socket | |
| import select | |
| import logging | |
| import logging.config | |
| import pickle |
| # -*- coding: utf-8 -*- | |
| import functools | |
| import logging | |
| import time | |
| from django.conf import settings | |
| from django.db import connection | |
| #!/usr/bin/python2.7 | |
| #-*- coding=utf-8 -*- | |
| import shlex | |
| import subprocess | |
| from tornado.gen import coroutine, Task, Return | |
| from tornado.process import Subprocess | |
| from tornado.ioloop import IOLoop |
| // HTML: | |
| <div class="display-type"></div> | |
| // CSS: | |
| // set the content of an element depending on the media query |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import redis | |
| import time | |
| class LockTimeout(BaseException): | |
| pass | |
| class Lock(object): | |
| """ | |
| Implements a distributed lock using Redis. |
Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it outgit pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out| from tornado import ioloop | |
| from tornado import iostream | |
| import socket | |
| class Envelope(object): | |
| def __init__(self, sender, rcpt, body, callback): | |
| self.sender = sender | |
| self.rcpt = rcpt[:] | |
| self.body = body | |
| self.callback = callback |
| #!/usr/bin/env python | |
| __author__ = 'Frank Smit <[email protected]>' | |
| __version__ = '0.1.0' | |
| import functools | |
| import psycopg2 | |
| from tornado.ioloop import IOLoop, PeriodicCallback |
| # Copyright (c) 2010, Philip Plante of EndlessPaths.com | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in |