Skip to content

Instantly share code, notes, and snippets.

@djs
djs / checker.py
Created June 3, 2012 22:58
print urls with 404
import fileinput
import sys
import urllib2
def check_404(url):
try:
urllib2.urlopen(url);
except urllib2.HTTPError as e:
if e.code == 404:
print url
@djs
djs / gist:3903021
Created October 17, 2012 00:33
os.walk
def walk(top, topdown=True, onerror=None, followlinks=False):
"""Directory tree generator.
For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), yields a 3-tuple
dirpath, dirnames, filenames
dirpath is a string, the path to the directory. dirnames is a list of
the names of the subdirectories in dirpath (excluding '.' and '..').
@djs
djs / gist:3936508
Created October 23, 2012 03:49
test case to break jedi-vim parameter popup
class Foo(object):
def __init__(self):
pass
def bar(self, baz, qux):
return baz + qux
def main():
x = Foo()
{
"editor.fontSize": 16,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"workbench.colorTheme": "Monokai",
"window.zoomLevel": 0
}