Skip to content

Instantly share code, notes, and snippets.

Dave Halter davidhalter

View GitHub Profile
@davidhalter
davidhalter / conftest.py
Created Jul 29, 2020
Pytest 5 Remote PDB
View conftest.py
import socket
import pdb
def pytest_addoption(parser):
parser.addoption("--remote-pdb", action='store_true',
help="Opens a remote pdb on localhost:8050. Works with xdist")
def pytest_exception_interact(node, call, report):
if node.config.option.remote_pdb:
tb = call.excinfo._excinfo[2]
@davidhalter
davidhalter / pep484transform.py
Created Dec 18, 2015
Jedi generates Pep 484 type annotations.
View pep484transform.py
"""
Transforms a normal Python file to pep484 annotations using Jedi.
Usage:
pep484transform.py <file> [-d]
Options:
-d, --debug Show Jedi's debug output.
"""
from os.path import abspath
@davidhalter
davidhalter / gist:4595055
Created Jan 22, 2013
download grooveshark favorites and song collection (with library).
View gist:4595055
#!/usr/bin/env python
import os
import json
import grooveshark
client = grooveshark.Client()
client.init()
@davidhalter
davidhalter / Makefile
Created Apr 29, 2012
Makefile. No filenames needed.
View Makefile
# -------------------------------------------------------
# Makefile to build whatever you want.
# It tries to find all the sources you have and builds
# dependencies, to detect header file changes.
# This is especially helpful for C/C++ beginners,
# who don't want to edit a Makefile.
# https://gist.github.com/2552967
# Written by David Halter <davidhalter88@gmail.com>
# -------------------------------------------------------
CC=g++
You can’t perform that action at this time.