Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
EMACSCLIENT=/usr/local/bin/emacsclient
ALT=$HOME/bin/start-emacs
if [ "$1" = "-e" ]; then
$EMACSCLIENT "$@"
else
$EMACSCLIENT -c -a $ALT "$@"
fi
(defun mine-set-sbt-keys-if-possible ()
(if (sbt:find-root)
(progn
(local-set-key (kbd "C-c s s") 'mine-sbt-switch)
(local-set-key (kbd "C-c s c") 'mine-sbt-compile)
(local-set-key (kbd "C-c s k") 'mine-sbt-console)
(local-set-key (kbd "C-c s l") 'mine-sbt-last)
(local-set-key (kbd "C-c s r") 'mine-sbt-run)
(local-set-key (kbd "C-c s t") 'mine-sbt-test)
(local-set-key (kbd "C-c s o") 'mine-sbt-test-only-current-test)
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
# adapted from https://github.com/blueyed/dotfiles/blob/master/usr/bin/docker-cleanup
# NOTE: i had to change the xargs
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
#!/bin/bash
echo -n "before: "
boot2docker ssh date
boot2docker ssh sudo ntpclient -s -h pool.ntp.org
echo -n "after: "
boot2docker ssh date
(defun mine-set-sbt-keys-if-possible ()
(if (sbt:find-root)
(progn
(local-set-key (kbd "C-c s s") 'mine-sbt-switch)
(local-set-key (kbd "C-c s c") 'mine-sbt-compile)
(local-set-key (kbd "C-c s k") 'mine-sbt-console)
(local-set-key (kbd "C-c s l") 'mine-sbt-last)
(local-set-key (kbd "C-c s r") 'mine-sbt-run)
(local-set-key (kbd "C-c s t") 'mine-sbt-test)
(local-set-key (kbd "C-c s o") 'mine-sbt-test-only-current-test)
(defun mine-command-line-tool (command &optional history history-symbol)
(let* ((rest-of-command (read-from-minibuffer (concat command " ") (car history) nil nil history-symbol))
(command-with-args (append (split-string command) (split-string rest-of-command)))
(args (cdr command-with-args))
(command (car command-with-args))
(name (mapconcat 'identity command-with-args " "))
(buffer-name (concat "*" name "*"))
(buffer (get-buffer-create buffer-name)))
(switch-to-buffer buffer)
(apply 'make-comint-in-buffer name buffer command nil args)))
(defvar curl-history nil)
(defun curl ()
(interactive)
(mine-command-line-tool "curl" curl-history 'curl-history))
#!/bin/sh
set -e
for i in `seq 10`; do
echo "-----------"
sbt "test"
done
#!/bin/sh
for dir in `find . -maxdepth 2 -name '.git' -type d`; do
echo $dir
git --git-dir=$dir "$@"
done
#!/bin/sh
for dir in `find . -maxdepth 2 -name '.git' -type d`; do
echo $dir
git --git-dir=$dir --work-tree=$dir/.. "$@"
done