This file contains 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
name: foo | |
channels: | |
- conda-forge | |
- bioconda | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1=conda_forge | |
- _openmp_mutex=4.5=1_gnu | |
- _r-mutex=1.0.1=anacondar_1 | |
- binutils_impl_linux-64=2.35=h18a2f87_9 |
This file contains 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
name: so-ipopt | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- pyomo | |
- ipopt |
This file contains 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
package main | |
import ( | |
"fmt" | |
"math" | |
"gonum.org/v1/gonum/stat/distuv" | |
) |
This file contains 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 conda run -n base --no-capture-output python | |
## Usage: conda-list-any.py [PACKAGE ...] | |
## Example: conda-list-any.py numpy pandas | |
import conda.gateways.logging | |
from conda.core.envs_manager import list_all_known_prefixes | |
from conda.cli.main_list import list_packages | |
from conda.common.compat import text_type | |
import sys |
This file contains 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 -le | |
# Usage: ./conda-archive.sh foo | |
# Result: creates "foo.full.yaml", "foo.min.yaml", and removes "foo" environment | |
echo "Archiving environment '$1' to YAML" | |
conda env export -vn $1 > $1.full.yaml | |
conda env export -vn $1 --from-history > $1.min.yaml |
This file contains 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 -l | |
# use tmp dir to avoid name conflicts | |
tmp=$(mktemp -d) | |
# solve environment, ignoring existing cache | |
CONDA_PKGS_DIRS=$tmp conda create -dp $tmp/0 --json "$@" |\ | |
# filter to tarball URLs | |
grep '"url"' | grep -oE 'https[^"]+' |\ | |
# download locally | |
xargs wget -c |
This file contains 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 | |
sudo launchctl kickstart -k system/com.apple.audio.coreaudiod |
This file contains 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
################################################################################# | |
# INSTALL MAMBA ON GOOGLE COLAB | |
################################################################################# | |
! wget -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh | |
! chmod +x miniconda.sh | |
! bash ./miniconda.sh -b -f -p /usr/local | |
! rm miniconda.sh | |
! conda config --add channels conda-forge | |
! conda install -y mamba | |
! mamba update -qy --all |
This file contains 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 | |
## space-separated input | |
## -n1: run each separately | |
## -P6: run up to 6 in parallel | |
## -I '{}': replace {} with argument | |
## \$ delays evaluation to bash execution | |
## waits randomly for up to five seconds, then prints | |
echo {1..12} |\ | |
xargs -n1 -P6 -I '{}' \ | |
bash -c "sleep \$[ \$RANDOM % 5 ]; echo {}" |
This file contains 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
library(rhdf5) | |
library(tidyverse) | |
read_ad_df <- function (file, name) { | |
x_attrs <- h5readAttributes(file, name) | |
## check requested entry is a dataframe | |
## TODO: do we need to check encoding-version? | |
stopifnot(x_attrs[['encoding-type']] == "dataframe") | |