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 BaseHTTPServer as b,sys,os,json,urlparse | |
| p=(json.loads(open(sys.argv[1]).read()) if os.path.exists(sys.argv[1]) else {}) | |
| n="<br/>" | |
| h="""<form action=%s method="post">Post: <textarea name="a"></textarea><input type="submit" value="Post!"/></form>""" | |
| y=lambda s:urlparse.parse_qs(s)['a'][0] | |
| class F(b.BaseHTTPRequestHandler): | |
| def do_GET(s): | |
| s.send_response(200) | |
| s.send_header("Content-type","text/html") | |
| s.end_headers() |
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 pygame as pg,sys | |
| pg.init() | |
| w=pg.display.set_mode((100,)*2) | |
| o=list(open(sys.argv[1]).read().replace("\n","")) | |
| px=py=50 | |
| j=0 | |
| k=pg.key.get_pressed | |
| t=lambda x,y:o[x/5+y/5*20] | |
| z=lambda i:min(95,max(0,i)) | |
| while 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
| import sys | |
| t={} | |
| def w(o): | |
| c=t | |
| for l in o: | |
| c[l]=c[l]if l in c else{} | |
| c=c[l] | |
| c[None]=None | |
| g=lambda t,b,i:reduce(lambda i,l:i+[b]if l is None else g(t[l],b+l,i),t,i) | |
| map(w,open(sys.argv[1]).read().split("\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
| import sys, os, socket | |
| s = socket.socket() | |
| s.bind((sys.argv[1], int(sys.argv[2]))) | |
| s.listen(5) | |
| try: | |
| while True: | |
| conn, addr = s.accept() | |
| path = os.path.join(os.getcwd(), "./"+conn.recv(4096).split("\n")[0].split(" ")[1]) | |
| conn.send((open(path).read() if os.path.isfile(path) else reduce(lambda x,s:x+"\n"+s+("/" if os.path.isdir(s) else ""),sorted(os.listdir(path)),"Directory "+path+" ls")) if os.path.exists(path) else '404: '+path) | |
| conn.close() |
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
| stack = [] | |
| compileStacks = [] | |
| words = {} | |
| builtins = {} | |
| lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason | |
| def prn(o): | |
| print(o) | |
| def clr(l): |
NewerOlder