This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: Django EC2 server | |
# Required-Start: networking | |
# Required-Stop: networking | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: Django server management script | |
# Description: Django server management script | |
### END INIT INFO |
# This is a step by step tutorial on how to run uwsgi in emperor mode, | |
# behind nginx on Fedora 20. I'll add to the tutorial as time goes on. | |
# SeLinux will likely be a pain (even in permissive mode), so please see my comment on how to fix it. | |
sudo yum upgrade | |
sudo yum install nano yum-utils gcc uwsgi-plugin-python3 nginx | |
yum-builddep python3-psycopg2 |
#!/bin/sh | |
# Settings for a PHP Project | |
# Using: | |
# * PHP Lint | |
# *- PHP CS | |
# *- PHP Analyzer | |
# *- EmptyLines Checker | |
# *- Scrutinizer | |
# * PHPCPD |
""" | |
The SQLAlchemy Shell. | |
This is just a wrapper for code.InteractiveConsole with some useful | |
defaults for using SQLAlchemy | |
""" | |
import sys | |
from IPython import embed |
root@OpenWrt:~# cat /etc/config/network | |
config 'interface' 'loopback' | |
option 'ifname' 'lo' | |
option 'proto' 'static' | |
option 'ipaddr' '127.0.0.1' | |
option 'netmask' '255.0.0.0' | |
config 'interface' 'lan' | |
option 'ifname' 'eth0.1' | |
option 'type' 'bridge' |
#!/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 |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
/* | |
gulpfile from one of my React applications which has a gulp --production build | |
set up. | |
Assumptions: | |
1. All your own .js/.jsx modules are somewhere under ./src, have unique | |
filenames and use Node.js-style requires WITHOUT any path information, just | |
the name of another module somewhere under ./src |
#!/usr/bin/env python | |
import base64, hashlib, hmac, json, sys, getpass | |
from Crypto.Cipher import AES | |
from Crypto.Hash import RIPEMD, SHA256 | |
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
def prompt(p): | |
return getpass.getpass(p + ": ") |