Skip to content

Instantly share code, notes, and snippets.

@mcouthon
mcouthon / dict_merge.py
Created September 7, 2017 07:47 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@mcouthon
mcouthon / list-all-repos.py
Last active March 17, 2020 13:32 — forked from ralphbean/list-all-repos.py
Script to list all repos for a github organization
#!/usr/bin/env python
""" Print all of the clone-urls for a GitHub organization.
It requires the pygithub3 module, which you can install like this::
$ sudo yum -y install python-virtualenv
$ mkdir scratch
$ cd scratch
$ virtualenv my-virtualenv