Put this at the top of your executable Rscript file:
options(error = quote({
dump.frames(to.file=T, dumpto='last.dump')
load('last.dump.rda')
print(last.dump)
q()
#!/bin/bash | |
set -e | |
if [[ -z ${K8S_JVM_POD} ]]; then | |
echo "K8S_JVM_POD not defined" | |
exit 1 | |
fi | |
EXEC="kubectl exec ${K8S_JVM_POD}" | |
CP="kubectl cp ${K8S_JVM_POD}" |
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
# good discussion here: http://stackoverflow.com/questions/4308168/sigmoidal-regression-with-scipy-numpy-python-etc | |
# curve_fit() example from here: http://permalink.gmane.org/gmane.comp.python.scientific.user/26238 | |
# other sigmoid functions here: http://en.wikipedia.org/wiki/Sigmoid_function | |
import numpy as np | |
import pylab | |
from scipy.optimize import curve_fit | |
def sigmoid(x, x0, k): | |
y = 1 / (1 + np.exp(-k*(x-x0))) |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/selection-join |
function mycd() | |
{ | |
#if this directory is writable then write to directory-based history file | |
#otherwise write history in the usual home-based history file | |
tmpDir=$PWD | |
echo "#"`date '+%s'` >> $HISTFILE | |
echo $USER' has exited '$PWD' for '$@ >> $HISTFILE | |
builtin cd "$@" # do actual cd | |
if [ -w $PWD ]; then export HISTFILE="$PWD/.dir_bash_history"; touch $HISTFILE; chmod --silent 777 $HISTFILE; | |
else export HISTFILE="$HOME/.bash_history"; |
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done |
# assume the following directory structure where contents of doc/ | |
# and source/ are already checked into repo., with the exception | |
# of the _build directory (i,e. you can check in _themes or _sources | |
# or whatever else). | |
# | |
# proj/ | |
# source/ | |
# doc/ | |
# remove doc/_build/html if present |
#!/bin/sh -e | |
# | |
# Usage: browser | |
# pipe html to a browser | |
# e.g. | |
# $ echo '<h1>hi mom!</h1>' | browser | |
# $ ron -5 man/rip.5.ron | browser | |
if [ -t 0 ]; then | |
if [ -n "$1" ]; then |