Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoine Rozo entwanne

View GitHub Profile
@entwanne
entwanne / tasks.py
Created Jul 31, 2018
Celery warm shutdown solo taskpool
View tasks.py
import asyncio
import time
from celery import Celery
app = Celery('tasks')
class TaskBackend:
View poker.py
#!/usr/bin/env python
import itertools
import random
from collections import Counter
from enum import IntEnum
card_ranks = range(2, 15)
card_colors = '♠♥♦♣'
cards = list(itertools.product(card_ranks, card_colors))
View gist:42050b38a35597f21601
class tail_rec:
inside = False
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
if tail_rec.inside:
self.args = args
self.kwargs = kwargs
View logins_2017.py
#!/usr/bin/env python2
from glob import glob
#logins = glob('*.jpg')
#logins.sort()
#print '\n'.join(["'%s' : ''," % l.replace('.jpg', '') for l in logins])
logins = {
'arambu_b' : 'benjamin',
You can’t perform that action at this time.