This file contains hidden or 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
# "Secrets" are just environment variables--I can never remember `-Ugex` etc. | |
function secret | |
switch (count $argv) | |
case 0 # Usage | |
echo "Usage: secret <name> [value]" | |
echo " If value is not provided, the secret is unset." | |
case 1 # Unset | |
set -e -Ug $argv[1] | |
case 2 # Set | |
set -Ux $argv[1] $argv[2] |
This file contains hidden or 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
DROP TABLE IF EXISTS elf_calories; | |
CREATE TABLE elf_calories ( | |
calories INT NULL | |
); | |
COPY elf_calories (calories) FROM '/tmp/aoc_day01.input' NULL AS ''; | |
WITH item_id_added AS ( | |
SELECT |
This file contains hidden or 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
# Switches between a "main" branch ($BRANCHES) and the last checked-out branch. | |
function main | |
set -l BRANCHES main master | |
for branch in $BRANCHES; | |
# Check if branch exists | |
if [ (git branch --list $branch) ] | |
# Check if branch is the currently checked-out branch | |
if not [ (git branch --show-current) = $branch ] |
This file contains hidden or 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
on alfred_script(q) | |
set theName to (q) | |
set isRunning to false | |
tell application "System Events" | |
if exists process "OmniFocus" then | |
set isRunning to true | |
end if | |
end tell |
This file contains hidden or 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
[alias] | |
amend = commit --amend | |
cane = commit --amend --no-edit | |
br = branch | |
brd = !git diff `git merge-base HEAD master` | |
brdt = !git difftool `git merge-base HEAD master` | |
brl = !git branch --sort=-committerdate | head -n 5 | |
ci = commit | |
co = checkout | |
di = diff |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
.PHONY: build | |
build: | |
hugo | |
s3cmd sync --delete-removed public/ s3://sneeu.com/ | |
aws cloudfront create-invalidation --distribution-id «REDACTED» --paths "/*" |
This file contains hidden or 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
import functools | |
def memoize(f): | |
memos = {} | |
@functools.wraps(f) | |
def g(*args): | |
if args not in memos: | |
print 'Calling' |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am sneeu on github. | |
* I am sneeu (https://keybase.io/sneeu) on keybase. | |
* I have a public key whose fingerprint is C3C1 78AF FB8D F39D 2B52 AD0F 9DEC 5627 576E 5629 | |
To claim this, I am signing this object: |
This file contains hidden or 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
[user] | |
name = John Sutherland | |
email = [email protected] | |
[alias] | |
amend = commit --amend -C HEAD | |
br = branch | |
brdi = !git diff `git merge-base HEAD master` | |
brdt = !git difftool `git merge-base HEAD master` | |
ci = commit |
NewerOlder