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 readline = require('readline'); | |
function main() { | |
readline.createInterface({ | |
input: process.stdin, | |
terminal: false, | |
}).on('line', function(line) { | |
console.log(line); | |
}); | |
} |
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 <string.h> | |
void *__memcpy_glibc_2_2_5(void *, const void *, size_t); | |
asm(".symver __memcpy_glibc_2_2_5, memcpy@GLIBC_2.2.5"); | |
void *__wrap_memcpy(void *dest, const void *src, size_t n) | |
{ | |
return __memcpy_glibc_2_2_5(dest, src, n); | |
} |
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
#vim: fileencoding=utf-8 | |
import mimetools | |
import itertools | |
class MultiPartForm(object): | |
def __init__(self): | |
self.form_fields = [] | |
self.files = [] |
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
# vim: fileencoding=utf-8 | |
import time, signal | |
from tornado import web, ioloop, options, httpserver | |
_SHUTDOWN_TIMEOUT = 30 | |
def make_safely_shutdown(server): | |
io_loop = server.io_loop or ioloop.IOLoop.instance() | |
def stop_handler(*args, **keywords): | |
def shutdown(): |
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
# vim: fileencoding=utf-8 | |
import sys, time | |
from multiprocessing.pool import ThreadPool | |
from tornado import web, gen, stack_context, httpserver, ioloop, util, options | |
_workers = ThreadPool() | |
def costly_task(n): # a costly task like processing images | |
time.sleep(n) | |
return n |
NewerOlder