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
class ArbitraryDateListView(ListView): | |
date_field = None | |
date_format = '%Y-%m-%d' | |
since_date = None | |
until_date = None | |
auto_until_date = False | |
def get_date_field(self): | |
if self.date_field is None: | |
raise ImproperlyConfigured("%s.date_field is required." % self.__class__.__name__) |
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 piazza_api import PiazzaAPI | |
import dateutil.parser | |
p = PiazzaAPI('hv3tfd1v38g7fc') | |
p.user_auth() | |
s_answers = 0 | |
i_answers = 0 | |
s_before_i = 0 |
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 mechanize | |
from BeautifulSoup import BeautifulSoup | |
USERNAME = "foo@bar.com" | |
PASSWORD = "quxadux" | |
def main(): | |
browser = mechanize.Browser() | |
print "Opening login page..." |
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
''' | |
Copyright (c) 2012, Joseph W. Dougherty | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright | |
notice, this list of conditions and the following disclaimer in the |
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 a quick and dirty script to grab the practice questions from | |
# the Free CCNA Workbook (http://www.freeccnaworkbook.com/) to place | |
# each question in its own file and be able to view one question at a time | |
from BeautifulSoup import BeautifulSoup | |
import urllib2 | |
page = urllib2.urlopen("http://www.freeccnaworkbook.com/labs/free-ccna-workbook-ccna-practice-exam/") | |
soup = BeautifulSoup(page) |
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
javascript:{$('p').show();$('#colorbox').hide();$('#cboxOverlay').hide();} |