- Add your project logo.
- Write a short introduction to the project.
- If you are using badges, add them here.
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
// For use with convore.com | |
/* | |
* Automatically increase the size of the input field as you type | |
*/ | |
javascript:void !function(a,b){var c=function(c){var d=$(this),e=parseInt(d.css("height")),f=c.keyCode===b||c.keyCode===13?19:this.scrollHeight,g;if(g=e-f)$("#message-list").css("margin-bottom",61+f),d.css("height",f),(g<0||a.scrollY<a.scrollMaxY)&&a.scroll(0,a.scrollY-g)};$("#footer").attr("style","height: auto !important"),$("#id-message").bind("keypress keyup",c).css("height",19),$("#post-message").find("input.btn").bind("click keyup",function(a){c.call($("#id-message"),a)})}(window) | |
/* | |
* Add permalinks to posts (click the time ago text) | |
* Based on previous work by balpha, https://convore.com/users/balpha/ |
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 | |
""" | |
corrupt | |
usage: ./corrupt.py --source=input.jpg [--output=corrupted.jpg] [--iterations=10] | |
originally: http://www.recyclism.com/corrupt.php | |
ported: @mattdennewitz | |
""" |
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
# pagination.py | |
class Paginator(object): | |
def __init__(self, query, per_page): | |
"""Initialize a paginator. | |
Arguments: | |
- query -- queryset from pymongo or mongoengine | |
- per_page -- number of items per page |
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, tornado.ioloop, tornado.options, tornado.web, os.path | |
from tornado.options import define, options | |
define("port", default=8888, help="run on the given port", type=int) | |
class Application(tornado.web.Application): | |
def __init__(self): | |
handlers = [ | |
(r"/", HomeHandler), | |
(r"/upload", UploadHandler) |