Skip to content

Instantly share code, notes, and snippets.

@ag7
ag7 / youtube_playlist_downloader.py
Last active August 29, 2015 14:25
Download youtube mp3 playlist into specific folder.
#!/usr/bin/env python
import sys, os, subprocess
# requirements: youtube-dl and ffmpeg
if __name__ == "__main__":
if len(sys.argv) != 4:
print "usage: youtube_playlist_downloader.py -o <dir> <playlist-link>"
sys.exit(1)
@ag7
ag7 / spacify.py
Created March 6, 2015 14:37
convert tabs to spaces inside source files
#!/usr/bin/env python
import sys, os, subprocess
# specify the source file extension here
sources = [".cpp", ".h"]
if __name__ == "__main__":
for root, _, files in os.walk(os.path.dirname(os.path.realpath(__file__))):
for fname, fext in [os.path.splitext(f) for f in files]:
@ag7
ag7 / include_graph.py
Last active December 20, 2015 04:28
30-lines include mess hunter
"""Generate a cpp project include graph with dot."""
import sys, os, re, optparse, tempfile, subprocess
if __name__ == '__main__':
# parse arguments
parser = optparse.OptionParser()
parser.add_option("-d", dest="input_dir",
help="input directory", default=".")
parser.add_option("-o", dest="output_file",