All Entries Filtered By Entry Type: code
March 18, 2008
[Daniel] Oh Snap!
#!/usr/bin/env python
"""Since SnapTalent (http://snaptalent.com/) seems to have some solid jobs and a decent site, but no list of ads, let's make one."""
import urllib2
base_url = 'http://snaptalent.com/ads/'
for i in xrange(255):
current_url = "%s%s" % (base_url, i)
try:
oh_snap = urllib2.urlopen(current_url)
if oh_snap.code == 200:
print "Valid URL: %s" % current_url
oh_snap.close()
except:
pass
Permalink
|
Comments (2)
November 18, 2007
[Daniel] Color 'ls' on Mac OS X
In '/etc/bashrc':
export CLICOLOR='cons35'
export LSCOLORS='ExGxcxdxCxegedabagacad'
Fire up a new terminal and enjoy.
December 7, 2006
[Daniel] Django Newforms
from django.newforms import *
class Test(Form):
name = CharField()
email = EmailField()
def view_test(request):
if request.POST:
form = Test({
"name": request.POST["name"],
"email": request.POST["email"],
})
if form.errors != {}:
# Process that data!
else:
form = Test()
return render_to_response("view_test.html", {"form": form})

