Skip to content

Instantly share code, notes, and snippets.

View oz123's full-sized avatar
🎯
Focusing

Oz Tiram oz123

🎯
Focusing
View GitHub Profile
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@oz123
oz123 / kombu_example.py
Last active February 27, 2017 15:07 — forked from vgoklani/kombu_example.py
update for Python3
from kombu import Exchange
from kombu import Queue
from kombu import BrokerConnection
class ProduceConsume(object):
def __init__(self, exchange_name, **options):
exchange = Exchange(exchange_name, type='fanout', durable=False)
queue_name = options.get('queue', exchange_name+'_queue')
self.queue = Queue(queue_name ,exchange)
@oz123
oz123 / sessiontest.py
Created September 11, 2016 07:24 — forked from thedemz/sessiontest.py
Example of using beaker sessions with bottle
import bottle
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'memory',
'session.cookie_expires': 300,
'session.auto': True
}
app = SessionMiddleware(bottle.app(), session_opts)
@oz123
oz123 / jessie.preseed
Last active January 11, 2020 22:57 — forked from sturadnidge/wheezy.preseed
working preseed for debian testing
###
#
# Preseed for a Debian based machine on kvm
#
# Boot this file with: press TAB on the installer
# add the following to the boot parameters:
#
# install keymap=en_US locale=en_US netcfg/get_hostname=testserve \
# netcfg/get_domain=carfax.eu preseed/url=http://192.168.XXX.XXX:8000/wheezy.preseed
#