This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one worker per CPU core | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# enumerate Tornado servers here | |
upstream main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
location ~ /(\d+) { | |
resolver 8.8.8.8; | |
rewrite ^/(\d+)/(.*) /$2 break; | |
proxy_pass_header Server; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
from random import randrange | |
import logging | |
from tornado.options import define, options | |
define("port", default=7777, help="run on the given port", type=int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.prototype.customFormat = function(formatString){ | |
var YYYY,YY,MMMM,MMM,MM,M,DDDD,DDD,DD,D,hhh,hh,h,mm,m,ss,s,ampm,AMPM,dMod,th; | |
var dateObject = this; | |
YY = ((YYYY=dateObject.getFullYear())+"").slice(-2); | |
MM = (M=dateObject.getMonth()+1)<10?('0'+M):M; | |
MMM = (MMMM=["January","February","March","April","May","June","July","August","September","October","November","December"][M-1]).substring(0,3); | |
DD = (D=dateObject.getDate())<10?('0'+D):D; | |
DDD = (DDDD=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][dateObject.getDay()]).substring(0,3); | |
th=(D>=10&&D<=20)?'th':((dMod=D%10)==1)?'st':(dMod==2)?'nd':(dMod==3)?'rd':'th'; | |
formatString = formatString.replace("#YYYY#",YYYY).replace("#YY#",YY).replace("#MMMM#",MMMM).replace("#MMM#",MMM).replace("#MM#",MM).replace("#M#",M).replace("#DD\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[include] | |
files = *.supervisor | |
[supervisord] | |
pidfile = /Users/hi/Desktop/quips/logs/supervisord.pid | |
logfile = /Users/hi/Desktop/quips/logs/supervisord.log | |
[supervisorctl] | |
serverurl = unix:///tmp/supervisord.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Logistic Regression with Stochastic Gradient Descent. | |
Copyright (c) 2009, Naoaki Okazaki | |
http://www.chokkan.org/publication/survey/logistic_regression_sgd.html | |
This code illustrates an implementation of logistic regression models | |
trained by Stochastic Gradient Decent (SGD). | |
This program reads a training set from STDIN, trains a logistic regression | |
model, evaluates the model on a test set (given by the first argument) if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --env-filter 'export GIT_AUTHOR_EMAIL="somehwere@gmail.com";GIT_AUTHOR_NAME="Moseley Swift"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.overlay { | |
-webkit-transition: all .3s; | |
-moz-transition: all .3s; | |
-ms-transition: all .3s; | |
-o-transition: all .3s; | |
transition: all .3s; | |
-webkit-transform: scale3d(0.1,0.1,1); | |
-moz-transform: scale3d(0.1,0.1,1); | |
-o-transform: scale3d(0.1,0.1,1); | |
transform: scale3d(0.1,0.1,1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import numpy as np | |
import scipy as scipy | |
import re | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from nltk.stem import LancasterStemmer,SnowballStemmer | |
from nltk.stem.snowball import EnglishStemmer | |
from nltk import word_tokenize | |
from sklearn import preprocessing,metrics,cross_validation | |
from sklearn.cross_validation import StratifiedKFold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import logging | |
import tornado.log | |
# For pretty log messages, if available | |
try: | |
import curses | |
except ImportError: | |
curses = None |
OlderNewer