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/sh | |
# Author: RA <[email protected]> | |
USAGE(){ | |
echo "Usage:fetchsub [eng] file" | |
} | |
[ $# -eq 0 -o "$1" = '--help' ] && USAGE && exit 0 | |
ERROR(){ |
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
import Image | |
basewidth = 300 | |
img = Image.open(‘fullsized_image.jpg’) | |
wpercent = (basewidth / float(img.size[0])) | |
hsize = int((float(img.size[1]) * float(wpercent))) | |
img = img.resize((basewidth, hsize), PIL.Image.ANTIALIAS) | |
img.save(‘resized_image.jpg’) |
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
import tornado.ioloop | |
import tornado.web | |
import tornado.httpserver | |
import tornado.httputil | |
import tempfile | |
class MainHandler(tornado.web.RequestHandler): | |
def put(self): | |
filename = self.request.body.name | |
# do stuff with the image |
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
import os | |
import uuid | |
import marshal | |
import binascii | |
import tornado.web | |
def Session(func): | |
def warpper(self, *args, **kwargs): |
NewerOlder