Skip to content

Instantly share code, notes, and snippets.

View chrisjbillington's full-sized avatar

Chris Billington chrisjbillington

  • Institute for Photonics and Advanced Sensing, University of Adelaide
  • Melbourne, Australia
  • X @chrisbilbo
View GitHub Profile
@chrisjbillington
chrisjbillington / find-venv-activate
Last active May 7, 2020 19:38
venv activate snippet
#! /usr/bin/python
import sys
from pathlib import Path
__doc__ = """Print the path of the activate script for a venv found in the current
directory or an ancestor directory. Intended use is to put this in your $PATH and add a
function to your bashrc like:
activate(){
activate_script="$(find-venv-activate)" || return
@chrisjbillington
chrisjbillington / delete_branches.py
Created May 3, 2020 23:35
Script to delete all remote branches that have been merged into master.
from subprocess import check_output, check_call
import sys
USAGE = """Error: invalid arguments.
usage: python delete_branches.py local_repository [remote]
remote defaults to 'origin' if not given."""
try:
REPO = sys.argv[1]
except IndexError:
import argparse
from subprocess import check_call
REPOS = [
'blacs',
'labscript',
'labscript_devices',
'labscript_utils',
'lyse',
'runmanager',