Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
def countChange(money: Int, coins: List[Int]): Int = | |
if (money < 0 || coins.isEmpty) | |
0 | |
else if (money == 0) | |
1 | |
else | |
countChange(money - coins.head, coins) + countChange(money, coins.tail) |
## | |
# Haversine Distance Calculation | |
# | |
# Accepts two coordinates in the form | |
# of a tuple. I.e. | |
# geo_a Array(Num, Num) | |
# geo_b Array(Num, Num) | |
# miles Boolean | |
# | |
# Returns the distance between these two |
# Enable the use of the `subl` command | |
subl () { | |
subl_path='C:\Program Files\Sublime Text 2\sublime_text.exe' | |
if test -t 0 | |
then | |
"$subl_path" $* | |
else | |
timestamp=`date +%s` | |
filename=$1 | |
shift |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.
from flask import make_response | |
from functools import wraps, update_wrapper | |
from datetime import datetime | |
def nocache(view): | |
@wraps(view) | |
def no_cache(*args, **kwargs): | |
response = make_response(view(*args, **kwargs)) | |
response.headers['Last-Modified'] = datetime.now() | |
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0' |
server { listen 80; | |
server_name example.com; | |
access_log /var/log/example.com/nginx.access.log; | |
error_log /var/log/example.com/nginx.error.log; | |
root /var/www/apps/example.com/public; | |
charset utf-8; | |
location / { | |
rewrite ^ https://$host$request_uri? permanent; | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Solarized | |
#FDF6E3,#EEE8D5,#93A1A1,#FDF6E3,#EEE8D5,#657B83,#2AA198,#DC322F | |
Solarized Dark | |
#073642,#002B36,#B58900,#FDF6E3,#CB4B16,#FDF6E3,#2AA198,#DC322F | |