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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# standard python imports | |
import logging | |
from rich.logging import RichHandler | |
from rich.traceback import install | |
import os | |
install() | |
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
#!/usr/bin/env bash | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ ./build.sh -r "REGISTRY/NAME" [OPTIONS] | |
#/ | |
#/ -c|--context) | |
#/ the context in which to do the `docker build` | |
#/ | |
#/ -r|--registry) |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""Allow imports from this directory.""" |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""Check environments for an environmental variable value.""" | |
import os | |
def check_environment(env_var, default=None): | |
"""Check environments for an environmental variable.""" | |
def boolify(var): | |
if isinstance(default, bool): | |
if var in [0, '0', 'FALSE', 'False', 'false', 'F', 'f']: |
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
loadPackages <- function(pkgs, repo = 'https://cloud.r-project.org', | |
lib = .libPaths()[1]) { | |
not_installed <- pkgs[!pkgs %in% rownames(installed.packages())] | |
install.packages(not_installed, repos = repo, lib = lib) | |
loaded <- unlist(lapply(pkgs, require, character.only = TRUE, quietly = TRUE)) | |
if (any(loaded == FALSE)) { | |
message(sprintf('The following packages failed to load: %s', | |
paste0(pkgs[!loaded], collapse = ', '))) | |
return(FALSE) | |
} |
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
#!/usr/bin/env bash | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ -h|-?|--help) | |
#/ show this help and exit | |
#/ | |
# 1}}} | |
# environment {{{1 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |