Skip to content

Instantly share code, notes, and snippets.

@Exirel
Exirel / uwsgi-exirel.conf
Created September 21, 2015 15:37
Local upstart configuration file used to serve a uwsgi python application
script
# SET ENV
. /home/fstrzelecki/.virtualenvs/exirel/bin/activate
# UPSTART CONFIG
respawn
respawn limit 5 10
# RUN UWSGI
exec uwsgi --master --die-on-term --socket :8091 --module exirel.wsgi
@Exirel
Exirel / test.py
Created January 4, 2014 18:43
Life's Game of John Horton Conway, with implementation OOP & FP - mainly for study purposes. The idea behind world.World class is to show the different part: where the OOP uses the mutability, and where it doesn't.
# -*- coding: utf-8 -*-
from worldfp import calculate_next
from world import World
def test_calculate_next():
# Three neighbors from True or False is True
assert calculate_next(False, [True] * 3 + [False] * 5)
assert calculate_next(True, [True] * 3 + [False] * 5)