Skip to content

Instantly share code, notes, and snippets.

@dellis23
dellis23 / CATCH_Keras_RL.md
Created Nov 9, 2017 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
View CATCH_Keras_RL.md
View gist:d076e6d449525f6f6c60
_
| \
| |
| |
|\ | |
/, ~\ / /
X `-.....-------./ /
~-. ~ ~ |
\ / |
\ /_ ___\ /
View gist:49862d39a4f355e1b3e2
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`
View nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
View nginx consul config
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 Feb 17, 2015
Seriously? No bash syntax highlighting? I guess ActionScript looks nice.
View consul docker service init
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`
View nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
View gist:ad62d5c8186a7cd9f7da
import random
from flask import Flask
app = Flask(__name__)
def find_prime(start):
"""
Find a prime greater than `start`.
"""
current = start
@dellis23
dellis23 / gist:5309143cb2e3bf17f8af
Created Feb 16, 2015
Split up lots of gmail actions into multiple worker threads.
View gist:5309143cb2e3bf17f8af
from Queue import Queue
import sys
from threading import Thread
import requests
headers = {
'x-same-domain': '1',
'origin': 'https://mail.google.com',
View markov.py
import random
class Markov(object):
def __init__(self, open_file, chain_size=3):
self.chain_size = chain_size
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
You can’t perform that action at this time.