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
*.pyc |
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
# -*- coding: utf-8 -*- | |
""" | |
codegen | |
~~~~~~~ | |
Extension to ast that allow ast -> python code generation. | |
:copyright: Copyright 2008 by Armin Ronacher. | |
:license: BSD. | |
""" |
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
test.py |
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
from subprocess import Popen, PIPE | |
from docx import opendocx, getdocumenttext | |
#http://stackoverflow.com/questions/5725278/python-help-using-pdfminer-as-a-library | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
from cStringIO import StringIO |
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
DB = (key) -> | |
store = window.localStorage | |
get: -> | |
JSON.parse store[key] or "{}" | |
put: (data) -> | |
store[key] = JSON.stringify(data) |
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 | |
class Segment(object): | |
def __init__(self,item,getter): | |
self.index,self._data = getter(item) | |
self.len = len(self._data) | |
def __repr__(self): | |
return "<<Segment[%s:%s]['%s']>>" % (self.index, self.len,self.data) |
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 json | |
import urllib | |
import requests | |
req = urllib.unquote('https://api.import.io/store/data/784a3159-a7c1-411b-8b9b-7c65743f23eb/_query?input/webpage/url=http%3A%2F%2Fmoz.com%2Ftop500&_user=44223ee8-63a2-45f2-9f3c-0e7aad8c38c9&_apikey=')+urllib.quote('BN2ukOiuoM4u9qIlrTt7TsPFe8RSQ7QgpaZLP/qUS1onqBx1aOsv4NgpRj0h03fpU02zAC+vQ6vIscKlcA2cSg==') | |
resp = requests.get(req) | |
resp.content | |
data = json.loads (resp.content ) |
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
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do | |
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz | |
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/ | |
import string | |
import zlib | |
import sys | |
import random | |
charset = string.letters + string.digits + "%/+=" |
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
from datetime import datetime | |
def yearsago(years, from_date=None): | |
if from_date is None: | |
from_date = datetime.now() | |
try: | |
return from_date.replace(year=from_date.year - years) | |
except: | |
# Must be 2/29! | |
assert from_date.month == 2 and from_date.day == 29 # can be removed | |
return from_date.replace(month=2, day=28, |
OlderNewer