Skip to content

Instantly share code, notes, and snippets.

View aalhour's full-sized avatar
🪂

Ahmad Alhour aalhour

🪂
View GitHub Profile
@aalhour
aalhour / typreter.md
Last active October 3, 2016 15:50
Code for the Super Tiny Interpreter TechTalk @ TrustYou.
@aalhour
aalhour / .gitconfig
Last active April 18, 2024 13:08
~/.gitconfig
[gpg]
format = ssh
[commit]
gpgsign = true
[push]
default = simple
autoSetupRemote = true
@aalhour
aalhour / gunicorn_start.bash
Created December 13, 2016 10:55 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@aalhour
aalhour / digitalocean-deploy-django
Created December 13, 2016 11:07 — forked from gustavohenrique/digitalocean-deploy-django
Steps to configure a django app on digitalocean.com
deploy django app on digitalocean
=================================
# Packages
sudo apt-get install python-pip python-dev python-virtualenv supervisor nginx
# Create dirs
mkdir -p /webapps/my-project/{logs,run}
@aalhour
aalhour / gunicorn.conf.py
Created December 13, 2016 11:09
Configuration Files for Nginx + Gunicorn + Supervisord (See original: https://gist.github.com/dstufft/997475)
bind = "127.0.0.1:9006"
workers = 2
worker_class = 'gevent'
max_requests = 1000
timeout = 30
keep_alive = 2
preload = True
@aalhour
aalhour / Django_Gunicorn_Nginx.makefile
Created December 13, 2016 15:46 — forked from efraintorlo/Django_Gunicorn_Nginx.makefile
Django with Gunicorn + Nginx
SHELL := /bin/bash
#-----------------------------------------------
# __ __ _ __ _ _
# | \/ | __ _| | _____ / _(_) | ___
# | |\/| |/ _ | |/ / _ \ |_| | |/ _ \
# | | | | (_| | < __/ _| | | __/
# |_| |_|\__,_|_|\_\___|_| |_|_|\___|
#
#-----------------------------------------------
# Makefile to use:
@aalhour
aalhour / supervisord.sh
Created January 15, 2017 18:13 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@aalhour
aalhour / async_psycopg2.py
Created February 24, 2017 08:25 — forked from FSX/async_psycopg2.py
A module for asynchronous PostgreSQL queries in Tornado.
#!/usr/bin/env python
__author__ = 'Frank Smit <[email protected]>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback
@aalhour
aalhour / ladder.md
Created June 16, 2017 21:06 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@aalhour
aalhour / eca.py
Last active October 29, 2017 14:49 — forked from nst/eca.py
Elementary Cellular Automata PNG images generator. Based on Nicolas Seriot's gist (https://goo.gl/fh4d5Y).
#!/usr/bin/env python3
__author__ = "Ahmad Alhour"
__date__ = "2017-10-29"
__website__ = "https://gist.github.com/aalhour/533b8ea1a1d71bbfb026c16d956aa6d2"
"""
eca.py
Elementary Cellular Automata PNG images generator. Based on Nicolas Seriot's gist (https://goo.gl/fh4d5Y).