brew install miniconda
conda config --remove channels defaults
conda config --add channels conda-forge
conda config --set channel_priority strict
Before changing the config, these are the default channels:
function getTypeName(x: any): string { | |
return x === undefined ? 'undefined' : x === null ? 'null' : /^(?:class|function) (\w+)/.exec(x.constructor.toString())![1] | |
} |
/bin/[ | |
/bin/aa-enabled | |
/bin/aa-exec | |
/bin/aa-features-abi | |
/bin/aclocal | |
/bin/aclocal-1.16 | |
/bin/addpart | |
/bin/addr2line | |
/bin/apt | |
/bin/apt-cache |
#!/usr/bin/env bash | |
set -eu -o pipefail | |
echo "Pruning local tracking branches that don't exist anymore on the remote…" | |
git update | |
echo "Pruning local branches that have been merged…" | |
echo "Note: top-level branches are considered protected, only branches with a / in their name will be deleted." | |
git branch --format '%(refname:lstrip=2)' --merged | grep '/' || true | xargs -n 1 git branch -d |
Object.defineProperty(self, 'document', { value: {}, }) | |
self.location = new URL('file:///nowhere') | |
import 'https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.asm.js' | |
const { loadPyodide } = await import('https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.mjs') | |
const pyodide = await loadPyodide() | |
await pyodide.loadPackage('micropip') | |
const micropip = pyodide.pyimport('micropip') | |
await Promise.all([ |
export type SleepOptions = { | |
signal?: AbortSignal | |
/** If set, aborting will not fail the promise but instead fulfil it right away. */ | |
skipOnAbort?: true | |
} | |
export const sleep = (ms: number, options?: SleepOptions) => | |
new Promise<void>((ok, ng) => { | |
// deno-lint-ignore prefer-const |
/** | |
* Implements buy-and-hold rebalancing by splitting some cash inflow into the | |
* most meaningful contributions: | |
* | |
* The buckets whose valuations have fallen the most behind their target weight | |
* are contributed to first. Then, contributions to the buckets with the largest | |
* inflow from the previous step are prioritized, as to minimize the number of | |
* transactions and thus transaction fees. | |
* | |
* @param values Range with the current valuation of the portfolio's constituents. |
import chalk from 'chalk' | |
import ora from 'ora' | |
import process from 'node:process' | |
const success = chalk.green.bold(`OK`) | |
const failure = chalk.red.bold(`FAILED`) | |
const excludeStackFragment = `(${new URL(import.meta.url).pathname}:` | |
type TestBlock = (params: { test: TestFunction }) => unknown | |
type TestFunction = (description: string, body: TestBlock) => void |
// Based on Da, Gurun and Warachka's 2014 paper: | |
// "Frog in the Pan: Continuous Information and Momentum" | |
// PDF: https://www3.nd.edu/~zda/Frog.pdf | |
//@version=5 | |
indicator("Information Discreteness", overlay=false, precision=1, timeframe="D") | |
LENGTH = input.int(title="Window Length", defval=365, minval=7) | |
SKIP_RECENT = input.int(title="Skip most recent", defval=30, minval=0) | |
MA_LENGTH = input.int(title="Average returns over", defval=7, minval=1) |