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
#!/bin/sh | |
set -eo pipefail | |
BASE=origin/dev | |
if [[ $1 == "-d" ]]; then | |
DELETE=1 | |
shift | |
fi |
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
#!/bin/zsh | |
# | |
# Shows the raw details of a commit and all its parents | |
# | |
if [[ $# < 1 ]]; then | |
SHA=HEAD | |
else | |
SHA=$1 |
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
#!/bin/sh | |
if [[ $# != 1 ]]; then | |
echo "usage: $0 SHA" | |
echo " Shows a list of submodules that exist at the given commit, along with their corresponding" | |
echo " submodule commits." | |
exit 1 | |
else | |
SHA=$1 | |
fi |
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
(* This is the original function. It works fine, but makes extra calls to check_left and check_right. *) | |
let sorting_hat id = | |
if not (base_case id) then Dead | |
else | |
begin | |
if check_left id && check_right id then Central | |
else if check_left id then Left | |
else if check_right id then Right | |
else Dead | |
end |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
from subprocess import Popen, PIPE | |
from subprocess import call | |
# Change this to True to see what will be deleted without deleting anything | |
DRY_RUN = False |
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
// At some point I thought this was very clever | |
// | |
// Six months later I was like, why the hell is the tag on this view 1008017??!?! | |
-(void)awakeFromNib | |
{ | |
[super awakeFromNib]; | |
int tag = [self tag]; | |
if (tag > 1000000) { | |
int residue = tag - (tag / 1000000) * 1000000; |
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
val shouldLaunchMissiles : Bool? = false | |
// A million lines later, programmer forgets that shouldLaunchMissiles is an optional | |
if shouldLaunchMissiles { | |
println("The only way to win is not to play") | |
missiles.launch() | |
} else { | |
println("Let there be peace on Earth") | |
kittens.release() | |
} |
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
#!/bin/zsh | |
# Makes a symbolic link in your current directory to each iPhone simulator's data directory | |
devices=~/Library/Developer/CoreSimulator/Devices | |
plb=/usr/libexec/PlistBuddy | |
for f in $devices/*; do | |
simname=`$plb $f/device.plist -c "Print :name"` | |
ln -s $f/data ./$simname |
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
/* | |
It appears that the Swift code generator requires fixed layout in a lot of contexts | |
where one might reasonably desire to use generics. Trying to do so gets you a | |
lovely error of this sort: | |
LLVM ERROR: unimplemented IRGen feature! non-fixed multi-payload enum layout | |
This is my hacky solution to that problem. I use a cell to encapsulate the generic | |
as a fixed-layout value. I've provided a prefix * operator to retrieve the value | |
(how retro!) in order to minimize the syntactic overhead of using the cell class. |
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
// | |
// ArrayTest.swift | |
// SwiftTest | |
// | |
// Swift array subtyping semantics test | |
// | |
// Created by Nathan Gray on 6/7/14. | |
// Copyright (c) 2014 Mellmo. All rights reserved. | |
// |
NewerOlder