Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
import sys, os.path, logging | |
try: | |
import sysconfig | |
except ImportError: | |
sysconfig = None | |
def warn_on_path_overlap(): | |
""" |
import tornado.ioloop | |
import tornado.web | |
import tornado.httpserver | |
import tornado.httputil | |
import json | |
class MainHandler(tornado.web.RequestHandler): | |
def post(self): | |
# do something useful | |
name = self.get_argument('foo') |
git archive --format zip --output /full/path/to/zipfile.zip master |
# A list of possible usernames to reserve to avoid | |
# vanity URL collision with resource paths | |
# It is a merged list of the recommendations from this Quora discussion: | |
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features | |
# Country TLDs found here: | |
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains | |
# Languages found here: |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#import <Foundation/Foundation.h> | |
#import <QuartzCore/QuartzCore.h> | |
// generate a UIColor from rgb and alpha values | |
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] | |
#define RGB(r, g, b) RGBA(r, g, b, 1.0) | |
// generate a UIColor | |
#define GRAYSCALEA(rgb, a) RGBA(rgb, rgb, rgb, a) | |
#define GRAYSCALE(rgb) GRAYSCALEA(rgb, 1.0) | |
// generate a UIColor from a hex and an alpha value |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
#!/usr/bin/env python | |
# Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/ | |
from queue import Queue | |
from threading import Thread | |
from functools import partial | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options |