Skip to content

Instantly share code, notes, and snippets.

View michal-stoma's full-sized avatar

Michal Stoma michal-stoma

  • Warsaw, Poland
View GitHub Profile
@michal-stoma
michal-stoma / cons.py
Last active September 1, 2019 19:47
Daily Coding Problem #5
''' Daily Coding Problem #5
This problem was asked by Jane Street.
cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.
Given this implementation of cons:
def cons(a, b):
def pair(f):
return f(a, b)
@michal-stoma
michal-stoma / yourapp
Created August 9, 2017 15:28 — forked from leplatrem/yourapp
gunicorn virtualenv init.d script (could be simpler with upstart)
#! /bin/bash
### BEGIN INIT INFO
# Provides: yourapp
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main django process
# Description: The gunicorn process that receives HTTP requests
# from nginx