Skip to content

Instantly share code, notes, and snippets.

View aalhour's full-sized avatar
💭
"That which I cannot build, I do not understand." ~ Richard Feynman

Ahmad Alhour aalhour

💭
"That which I cannot build, I do not understand." ~ Richard Feynman
View GitHub Profile
@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 / 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_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 / .gitconfig
Last active April 18, 2024 13:08
~/.gitconfig
[gpg]
format = ssh
[commit]
gpgsign = true
[push]
default = simple
autoSetupRemote = true
@aalhour
aalhour / typreter.md
Last active October 3, 2016 15:50
Code for the Super Tiny Interpreter TechTalk @ TrustYou.
@aalhour
aalhour / README.md
Last active March 9, 2018 09:19
BrainFuck Interpreter and REPL in Python 3

PBFI: Pythonic BrainFuck Interpreter

Yet another educational interpreter for the BrainFuck Programming Language, written in Python 3. This might not be the shortest BrainFuck interpreter that you had come acorss, however the style of programming is for educational purposes only.

USAGE:

Help:

@aalhour
aalhour / README.md
Created July 7, 2016 16:21 — forked from mbostock/.block
Prim’s Algorithm V

Another variation of color-cycling a spanning tree generated by Prim’s algorithm. Here the periodicity of the color scale by tree depth is varied over time, alternating between emphasis of micro and macro structure. This idea was suggested in a Hacker News comment.

@aalhour
aalhour / gist:766ba93db038bcff1acf
Created March 21, 2016 21:14 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")