Skip to content

Instantly share code, notes, and snippets.

View emlun's full-sized avatar

Emil Lundberg emlun

View GitHub Profile
/**
* <p>
* <code>_.group(functions, [context])</code>
* </p>
* <p>
* <code>_.group(*functions)</code>
* </p>
*
* <p>
* Returns a function <code>f</code> that wraps an array of functions and
/*
Make sure Jasmine is included somehow, then declare a dependency on this module.
Usage:
expect(fn).toBeFunction()
*/
define([
'underscore',
], function(_) {
beforeEach(function() {
@emlun
emlun / i3-shell.sh
Created August 11, 2014 15:12 — forked from viking/i3-shell.sh
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
CMD=xterm
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
@emlun
emlun / .pentadactylrc
Last active August 29, 2015 14:07
Custom Pentadactyl command to make Stack Exchange vote buttons clickable (usable with hints mode)
group -description "Stack Exchange network" -locations=stackexchange.com,stackoverflow.com,superuser.com stackexchange
command -description "Make Stack Exchange vote buttons clickable" -group stackexchange -nargs=0 vote javascript (function() { $('.vote a').attr('href', 'javascript:void(0)'); })()
@emlun
emlun / foo.cpp
Last active August 29, 2015 14:07
C++ classes have themselves as implicit inner class
struct Foo {
int x;
Foo() : x(0) {};
explicit Foo(int x) : x(x) {};
bool operator>(const Foo& other) const {
return x > other.x;
}
};
@emlun
emlun / mkcert.sh
Last active August 29, 2015 14:08
#!/bin/bash
FILENAME="device"
KEY_FILE="${FILENAME}.key"
REQUEST_FILE="${FILENAME}.csr"
CERT_FILE="${FILENAME}.crt"
UPLOAD_FILE="tmp/${REQUEST_FILE}"
DOWNLOAD_FILE="tmp/${CERT_FILE}"
Description='eduroam'
Interface=wlp9s0 # EDIT THIS
Connection=wireless
Security=wpa-configsection
IP=dhcp
WPAConfigSection=(
'ssid="eduroam"'
'key_mgmt=WPA-EAP'
'eap=TTLS'
@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:

#!/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/
@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