Skip to content

Instantly share code, notes, and snippets.

- issuetype: Story
project: LF
reporter: nino
components: Spam
assignee: eugene
- manifest:
fixVersions: Narnia
links:
- key: PP-146
type: relates to
customFields:
actual: customfield_10501
at: assignee
customer: customfield_10013
epicLink: customfield_11000
epicName: customfield_11001
expected: customfield_10502
links: issueLinks
points: customfield_10004
ptype: customfield_11401
@ninowalker
ninowalker / gist:8292135
Created January 6, 2014 23:45
Load/invert the DB from http://urlblacklist.com
import glob
import collections
import re
def load(root="./"):
h = {}
for f in glob.glob(root + "*/domains"):
d = f.replace(root, "").replace("/domains", "")
h[d] = set()
with open(f) as _f:
This is a test
@ninowalker
ninowalker / gist:1482729
Created December 15, 2011 20:28
Convert HTML entities to unicode
import htmlentitydefs
import re
def unescape_entities(m):
return unichr(htmlentitydefs.name2codepoint[m.group(1)])
print re.sub(r'&(\w+);', unescape_entities, "× ™Foo&bar")
@ninowalker
ninowalker / server.py
Created December 10, 2011 02:02
A simple web server in two (three) steps
#
# Source: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
#
# Simple server in two steps:
# - create an index.html file.
# - run:
# python server.py [<port>]
# - go to: