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/bash | |
# Git Gat: The Git Gatling Gun! | |
# Perform operations machine-gun style on side-by-side git repositories. | |
# | |
# Save this somewhere on your path as git-gat (or whatever you want to call it). | |
# Usage: | |
# | |
# git gat status | |
# git gat -f status # Perform operation even if the repo is dirty. |
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
// | |
// BitwiseOptions.swift | |
// | |
// Created by Gregory Higley on 11/24/14. | |
// Copyright (c) 2014 Prosumma LLC. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
/* | |
The reason this does not return a value is that SequenceType | |
is very general. It has no methods for modifying the sequence, | |
only traversing it. | |
Instead, we pass our "unique" method a closure that tells it | |
how to add a value to our result. The result is not visible | |
at all to this method. It is captured by our closure. | |
The reason we don't pass the result as a parameter is because it |
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
/* | |
Replace the name of my Swift module, Prosumma, with your own, or this will not compile. | |
As of 1.0, Swift lacks mixins (as in Ruby) or the ability to extend protocols (as in C#), which means lots of | |
cumbersome boilerplate. I've tried to cut down on that with this little snippet. First, you'll notice that | |
there are no actual minimum and maximum functions defined. To achieve that, do the following: | |
var lowest: Int? = [5, 4, 3].most(<) | |
var highest: Int? = [5, 4, 3].most(>) |
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
-- Inspired by https://wiki.postgresql.org/wiki/Sprintf, | |
-- but really, pretty different. | |
CREATE FUNCTION sprintf(_format TEXT, VARIADIC _args ANYARRAY) RETURNS TEXT | |
LANGUAGE PLPGSQL | |
STRICT IMMUTABLE | |
AS $$ | |
DECLARE _f INT DEFAULT 0; -- Index of current character in format string | |
DECLARE _c TEXT; -- Current character | |
DECLARE _match TEXT; | |
DECLARE _matches TEXT[]; |
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
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# Version 2.0 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# | |
# 2013 updates: | |
# - fixed the broken "save personal Schemes" | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, |
NewerOlder