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 | |
set -euo pipefail | |
function is-git-repository { | |
[[ -d "$1/.git" ]] || (cd "$1" && git rev-parse --git-dir > /dev/null 2>&1) | |
} | |
function echo-is-dirty { | |
cd "$1" | |
if [[ ! -z $(git status -s) ]] |
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
// I tried to translate the GADT examples I have in my blog post[1] about GADTs | |
// from OCaml to Scala. | |
// | |
// A direct translation resulted in the code below, but I had to add two asInstanceOf | |
// so I don't consider this a successful translations. | |
// | |
// Any idea how to get rid of the asInstanceOf calls? Is it even possible? | |
// | |
// [1]: http://mads-hartmann.com/ocaml/2015/01/05/gadt-ocaml.html |
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 | |
# | |
# usage: prototype-deploy <machine-name> <image-name> <container-name> | |
# | |
set -euo pipefail | |
# | |
# Functions | |
# |
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
(defun mhj/show-project-explorer () | |
"Project dired buffer on the side of the frame. | |
Shows the projectile root folder using dired on the left side of | |
the frame and makes it a dedicated window for that buffer." | |
(let ((buffer (dired-noselect (projectile-project-root)))) | |
(progn | |
(display-buffer-in-side-window buffer '((side . left) (window-width . 0.2))) | |
(set-window-dedicated-p (get-buffer-window buffer) t) | |
(select-window (get-buffer-window buffer))))) |
I hereby claim:
- I am mads-hartmann on github.
- I am mads_hartmann (https://keybase.io/mads_hartmann) on keybase.
- I have a public key whose fingerprint is BF71 A0F9 6C4C B0DF F30D 73D5 99E6 8045 0B61 2B11
To claim this, I am signing this object:
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
"use babel"; | |
atom.commands.add('atom-text-editor', 'hartmann:just-one-space', () => { | |
const editor = atom.workspace.getActiveTextEditor(); | |
if (!editor) { | |
return; | |
} | |
const changes = editor.getCursorBufferPositions().map((point) => { |
I hereby claim:
- I am mads379 on github.
- I am mads_hartmann (https://keybase.io/mads_hartmann) on keybase.
- I have a public key whose fingerprint is BF71 A0F9 6C4C B0DF F30D 73D5 99E6 8045 0B61 2B11
To claim this, I am signing this object:
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
(add-hook 'eshell-mode-hook | |
(lambda () | |
(define-key eshell-mode-map (kbd "C-c") 'eshell-kill-process))) |
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
object Peano { | |
sealed trait Nat | |
trait Zero extends Nat | |
object ZeroV extends Zero | |
case class Succ[A <: Nat](x: A) extends Nat | |
trait Sum[A <: Nat, B <: Nat] { | |
type Out <: Nat | |
} |
NewerOlder