Skip to content

Instantly share code, notes, and snippets.

View eriknguyen's full-sized avatar
🎯
f̶̗̣̰̥̝̘̹̞́͑̋̄̋̀̿͐̑͜͝ọ̴͙̦̟̾c̵̡̱̭̲̣͔̦͎͂̈̈́̆͊͗̚͝u̴̡͖̮̬͍͍͊͋̈́̓͠s̷̱̎̓̐͆

Erik Nguyen eriknguyen

🎯
f̶̗̣̰̥̝̘̹̞́͑̋̄̋̀̿͐̑͜͝ọ̴͙̦̟̾c̵̡̱̭̲̣͔̦͎͂̈̈́̆͊͗̚͝u̴̡͖̮̬͍͍͊͋̈́̓͠s̷̱̎̓̐͆
View GitHub Profile
@eriknguyen
eriknguyen / name_conventions_dictionaries.py
Last active February 2, 2018 09:01 — forked from jllopezpino/name_conventions_dictionaries.py
Replace keys in underscore lowercase convention for camel case convention and vice versa.
def camel_to_underscore(name):
"""
Convert a name from camel case convention to underscore lower case convention.
Args:
name (str): name in camel case convention.
Returns:
name in underscore lowercase convention.
"""
camel_pat = compile(r'([A-Z])')
@eriknguyen
eriknguyen / gunicorn_start.bash
Created November 7, 2017 12:56 — 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