This file contains hidden or 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<stdio.h> | |
#include "y.tab.h" | |
char *strclone(char *str); | |
/* | |
#define STRING "str" | |
#define NUMBER "number" | |
#define O_BEGIN "o_begin" | |
#define O_END "o_end" | |
#define A_BEGIN "a_begin" |
This file contains hidden or 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/python | |
import os | |
from subprocess import call | |
import subprocess as sp | |
class _cmd (object): | |
def __init__(self, sh, cmd): | |
self.c = cmd | |
self.sh = sh |
This file contains hidden or 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 tornado.ioloop | |
import tornado.web | |
import tornado.process | |
import tornado.netutil | |
from tornado.httpserver import HTTPServer | |
import time | |
class MainHandler(tornado.web.RequestHandler): |
This file contains hidden or 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 web | |
import sys, time, os | |
### URL Routing | |
urls = ( | |
'(.*)', 'fallback', | |
); |
This file contains hidden or 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, re | |
from getopt import getopt | |
''' | |
Just too lazy figuring out egrep alone, so... | |
$ ./nocomment.py proc_line < md.c | |
proc_line (char *line, unsigned len, struct session_args *a) { |
This file contains hidden or 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
TEST_URL='/resource' | |
LOGIN_URL='/login' | |
LOGOUT_URL='/logout' | |
application = tornado.web.Application([ | |
(LOGIN_URL, LoginHandler), | |
(LOGOUT_URL, LogoutHandler), | |
(TEST_URL, ResourceHandler), | |
], cookie_secret='cookie_secret', login_url=LOGIN_URL) | |
This file contains hidden or 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
# When connecting using pymongo, specify "replicaSet" | |
# This allows default port running secondary nodes. | |
pymongo.MongoClient(replicaSet='rs0', slaveOk=True) |
This file contains hidden or 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
var http = require('http'), | |
phantom=require('node-phantom'), // https://github.com/alexscheelmeyer/node-phantom | |
urlparse = require('url'); | |
function proxy_url(url, res) { | |
phantom.create(function(err,ph) { | |
return ph.createPage(function(err,page) { | |
This file contains hidden or 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
a.out: a.o b.o def.o | |
%.o: %.cpp | |
clang++ -c -o $@ $< |
This file contains hidden or 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 | |
from __future__ import print_function | |
import gevent | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import gevent.hub | |
import redis |
OlderNewer