Support sandboxes for Elixir, Haskell, Clojure

The dream is to create an offline version of something like repl.it.
This commit is contained in:
William Carroll 2019-05-13 16:37:47 +01:00
parent 011d302b9e
commit 5cb0aebbd3
2 changed files with 8 additions and 11 deletions

View file

@ -88,7 +88,10 @@ alias tism="MIX_ENV=test iex -S mix"
alias mdg="mix deps.get"
alias mdu="mix deps.update"
alias mdup="mix docker.up"
alias sandbox_ex='dkish elixir iex' # depends on the docker aliases
alias repl_ex='dkish elixir iex' # depends on the docker aliases
# Clojure
alias repl_clj='dkish clojure lein repl'
# GPG
alias gpged='gpg --edit-key wpcarro@gmail.com'
@ -135,7 +138,7 @@ alias se="stack exec --"
alias sc="stack clean"
# alias st="stack test" # blocks suckless-terminal
alias haddocks='open "$(stack path --local-doc-root)/index.html"'
alias sandbox_hk='dkish haskell ghci'
alias repl_hk='dkish haskell ghci'
# Kubernetes
alias kc="kubectl"

View file

@ -104,15 +104,9 @@ dkcsh() {
}
dkish() {
# Runs a Docker container with `/usr/bin/env bash`.
# `dkish` stands for DocKer Image SHell.
# Note: This defers from `dksh`, which accepts a container instead of an
# image.
# Usage: dkrit <container_name> [command]
image=$1
cmd=${2-/bin/bash}
docker run -it "$image" "$cmd"
# Runs a Docker container interactively
# Usage: dkrit <container_name> <command> [...args]
docker run -it $@
}
# Emacs