Skip to content

Instantly share code, notes, and snippets.

View dellis23's full-sized avatar

Daniel Ellis dellis23

View GitHub Profile
@dellis23
dellis23 / gist:5309143cb2e3bf17f8af
Created February 16, 2015 00:25
Split up lots of gmail actions into multiple worker threads.
from Queue import Queue
import sys
from threading import Thread
import requests
headers = {
'x-same-domain': '1',
'origin': 'https://mail.google.com',
import random
from flask import Flask
app = Flask(__name__)
def find_prime(start):
"""
Find a prime greater than `start`.
"""
current = start
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@dellis23
dellis23 / consul docker service init
Created February 17, 2015 00:27
Seriously? No bash syntax highlighting? I guess ActionScript looks nice.
description "Consul server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
# Make sure to use all our CPUs, because Consul can block a scheduler thread
export GOMAXPROCS=`nproc`
@dellis23
dellis23 / nginx consul config
Created February 17, 2015 01:50
nginx consul config
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@dellis23
dellis23 / nginx.conf
Last active August 29, 2015 14:15
Testing...
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
description "Consul server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
# Make sure to use all our CPUs, because Consul can block a scheduler thread
export GOMAXPROCS=`nproc`
_
| \
| |
| |
|\ | |
/, ~\ / /
X `-.....-------./ /
~-. ~ ~ |
\ / |
\ /_ ___\ /
@dellis23
dellis23 / CATCH_Keras_RL.md
Created November 9, 2017 01:38 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
import argparse
import json
import requests
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument('owner', type=str)
parser.add_argument('repo', type=str)
args = parser.parse_args()