Skip to content

Instantly share code, notes, and snippets.

View pfctdayelise's full-sized avatar

Brianna Laugher pfctdayelise

View GitHub Profile
@pfctdayelise
pfctdayelise / mockingwithdecorators.py
Created July 5, 2012 00:58
Mocking functions with decorators
class Foo(object):
def __init__(self, a, b):
self._a = a
self._b = b
@property
def a(self):
return self._a
@pfctdayelise
pfctdayelise / gist:2657480
Created May 11, 2012 04:10
lxml.html.clean Bug?
>>> from lxml.html.clean import clean_html
>>> clean_html("This is my abstract. I propose a set of lightning talks ( < 5 minutes).")
'<p>This is my abstract. I propose a set of lightning talks ( </p>'
@pfctdayelise
pfctdayelise / checkBadware.py
Created February 7, 2012 13:57
something to help me detect badware. hopefully useful to run as cron.
#!/usr/bin/env python
import os
import argparse
import urllib
from BeautifulSoup import BeautifulSoup # 3.2.0
def getPagesForOnePath(path):
f = urllib.urlopen(path)
soup = BeautifulSoup(f)