Skip to content

Instantly share code, notes, and snippets.

View ljuba-ned's full-sized avatar

Ljuba Nedeljkovic ljuba-ned

View GitHub Profile

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@ljuba-ned
ljuba-ned / bad_url.py
Created January 27, 2013 01:29
Python: check bad url function
from urllib2 import urlopen
def bad_url(url):
fail = False
try:
code = urlopen(url).code
if code > 400:
fail = True
except:
fail = True
from urllib2 import urlopen
URLfail = False
try:
code = urlopen(the_url).code
if code >= 400:
URLfail = True
except:
URLfail = True