This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def traverse_nested_dict( | |
| d: dict, min_depth: int = 0, max_depth: int | None = None, yield_objects=True | |
| ): | |
| """Traverse over a nested dict. | |
| Creates a generator yielding key-value pairs. Keys will be tuples containing the path to the value, e.g.:: | |
| (top_key, level_1_key), value | |
| Parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Maximum file size limit in MiB | |
| limitMiB=${GIT_MAX_MIB:-5} # Default 5MiB | |
| if [ $limitMiB -le 0 ]; then | |
| exit 0 | |
| fi | |
| # Go to repo root folder | |
| cd "$(git rev-parse --show-toplevel)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Restart in terminal if called without one | |
| if [ ! -t 1 ]; then | |
| urxvt -name "dwm-floating" -title vpn -geometry 120x20 -e "$0" | |
| fi | |
| all_off="all off" | |
| list_vpns () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Simple wrapper around AWS CLI docker image to share the users config but | |
| # keeping the file permissions consistent on Linux. | |
| # Make this executable and put this as aws in your $PATH | |
| set -e | |
| CONFDIR="$HOME/.aws" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import wraps | |
| from inspect import getmembers, ismethod | |
| class MemoizingDAG: | |
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) | |
| # memory of target results | |
| self._built_targets = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %%javascript | |
| var kernel = IPython.notebook.kernel; | |
| var thename = window.document.getElementById("notebook_name").innerHTML; | |
| var command = "notebook_name = " + "'" + thename + "'"; | |
| kernel.execute(command); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) Jupyter Development Team | |
| # Jan Eike von Seggern <[email protected]> | |
| # Distributed under the terms of the Modified BSD License. | |
| ## Template to build a hierarchy of dependent docker images. | |
| ## Based on https://github.com/jupyter/docker-stacks/blob/master/Makefile | |
| ## Builds are tracked via build-stamps in $BUILD_DIR. | |
| ## Dependencies for each image are created automatically for all files tracked by git. | |
| ## | |
| ## Usage (see examples below): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def group_indices(sarr, window_size=None, start=None): | |
| """Get list with indices of entries of sorted `sarr` grouped in windows. | |
| Parameters | |
| ---------- | |
| sarr : ndarray | |
| Sorted array. | |
| window_size : float, optional |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff -r 8f9965d9727f Makefile | |
| --- a/Makefile Wed Oct 03 15:54:17 2012 +0200 | |
| +++ b/Makefile Thu Oct 25 20:10:54 2012 +0200 | |
| @@ -24,7 +24,7 @@ | |
| @echo creating $@ from config.def.h | |
| @cp config.def.h $@ | |
| -dwm: ${OBJ} | |
| +dwm: ${OBJ} cwd.c | |
| @echo CC -o $@ |