Skip to content

Instantly share code, notes, and snippets.

View emlun's full-sized avatar

Emil Lundberg emlun

View GitHub Profile
@emlun
emlun / README.md
Last active June 4, 2017 21:00
GRand Unified Storage system
@emlun
emlun / two-combinations.clj
Last active April 9, 2017 13:51
two-combinations
(defn pair-with-all-in
{ :test #(let [f pair-with-all-in]
(is (= [] (f 0 [])))
(is (= [ [0 1] ] (f 0 [1])))
(is (= [ [0 1] [0 2] ] (f 0 [1 2])))
)
}
[ x ys ]
(map (fn [y] [x y]) ys))
@emlun
emlun / .gitconfig
Last active June 22, 2016 08:08
Git config
[core]
autocrlf = input
editor = vim
[push]
default = simple
[color]
ui = true
#!/bin/bash
# Clean out Syncthing *.sync-conflict-* files from Password Store
#
# Usage: Run the script from anywhere with no parameters.
#
# The script will remove all conflict files in `~/.password-store` for which
# the plaintext contents of the original file and the conflict file have the
# same SHA256 checksum. I.e. if `foo.sync-conflict-20151115-205258.gpg` and
# `foo.gpg` have the same checksums after decrypting, then the former will be
# removed.
var _ = require('underscore');
var list1 = [{ id: 0, a: 'a0', b: 'b0' }, { id: 1, a: 'a1', c: 'c1' }];
var list2 = [{ id: 0, c: 'c0', d: 'd0' }, { id: 1, a: 'A1', b: 'b1' }];
var merged = _(list1).chain()
.concat(list2)
.groupBy('id')
.map(function(group, id) {
return _(group).reduce(function(result, next) {
@emlun
emlun / .bash_alias
Last active February 3, 2016 11:20
Bare minimum Bash settings
alias ls="ls -h --color=auto"
alias ll="ls -lh"
alias la="ls -lah"
@emlun
emlun / gitalias
Last active August 29, 2015 14:27
My git alias configuration
# This is free and unencumbered text released into the public domain.
# For more information, please refer to <http://unlicense.org/>
[alias]
a = add -up
aa = !yes a | git a
amend = commit --amend -C HEAD
d = diff
di = diff --ignore-all-space
#!/bin/bash
# Author: Emil Lundberg <lundberg.emil@gmail.com> <https://keybase.io/emlun>
#
# This is free and unencumbered software released into the public domain.
# See http://unlicense.org/ for the full license.
#
# Usage:
#
# $ confgit ls # List git repositories in ~/.config/
# $ confgit foo init # Clone 'foo.git' from remote into ~/.config/foo/
#!/bin/bash
# Utility script for making it easier to sign stuff for Keybase.io with an
# airgapped offline key.
#
# Usage:
# 1. Set the `REMOVABLE_DEVICE_UUID` below (see `$ lsblk -o +FSTYPE,UUID`)
# 2. Go to keybase.io and add a new key or proof, track someone etc.
# 3. Choose to sign manually
# 4. Copy the script to the Xorg primary clipboard (should be enough to just
# select it all - triple-clicking the text box does the trick in Firefox)
@emlun
emlun / keybase.md
Created February 10, 2015 01:11
keybase.md

Keybase proof

I hereby claim:

  • I am emlun on github.
  • I am emlun (https://keybase.io/emlun) on keybase.
  • I have a public key whose fingerprint is EB86 2761 6EC1 971D F076 F2FF 2BF5 FD22 FCAB DE73

To claim this, I am signing this object: