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
| #!/bin/bash | |
| SCRIPT=$(readlink -f $0) | |
| SCRIPTPATH=`dirname $SCRIPT` | |
| if [[ "$1" == "edit" ]] | |
| then | |
| sudo ne ${SCRIPT} | |
| fi | |
| wget -rnv -l100 --delete-after --mirror -p "$1" |
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
| package main | |
| /* | |
| Like Snoops Gin and Juice, but gin and socket.io... | |
| https://github.com/gin-gonic/gin/issues/124 | |
| */ | |
| var Socketio_Server * socketio.Server | |
| func main() { |
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
| def http_post(host, selector, body): | |
| h = httplib.HTTPConnection(host) | |
| h.request('POST', selector, body) | |
| res = h.getresponse() | |
| return res.status, res.reason, res.read() |
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 os | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| class StreamHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous | |
| def get(self): | |
| #self.set_header("Content-Type", "application/ogg+ogg") |
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 tornado.httpclient | |
| import tornado.ioloop | |
| import gevent | |
| def on_complete(data): | |
| print data.body[0:10] |
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.httpclient | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| class MainHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous | |
| def get(self): |
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.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.httpclient | |
| from tornado.testing import AsyncHTTPTestCase | |
| class MainHandler(tornado.web.RequestHandler): | |
| @tornado.web.asynchronous |
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
| #!/bin/env python | |
| execfile('./htdocs/reviewboard.wsgi') | |
| from tornado.options import options, define, parse_command_line | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.wsgi | |
| define('port', type=int, default=8080) |
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
| <html> | |
| <title> | |
| JSON Example | |
| </title> | |
| <body> | |
| <FORM ACTION="/blog" METHOD=POST> | |
| Title: <input type="text" name="title"> | |
| Author: <input type="text" name="author"> |
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.wsgi | |
| import tornado.httpserver | |
| import tornado.ioloop | |
| from Pyblosxom.pyblosxom import PyBlosxomWSGIApp | |
| container = tornado.wsgi.WSGIContainer(PyBlosxomWSGIApp()) | |
| http_server = tornado.httpserver.HTTPServer(container) |