This file contains 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
/// Withable is a simple protocol to make constructing | |
/// and modifying objects with multiple properties | |
/// more pleasant (functional, chainable, point-free) | |
public protocol Withable { | |
init() | |
} | |
public extension Withable { | |
/// Construct a new instance, setting an arbitrary subset of properties | |
init(with config: (inout Self) -> Void) { |
This file contains 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
// | |
// AsyncOperation.swift | |
// Slopes | |
// | |
import Foundation | |
class AsyncOperation: Operation { | |
private let stateLock = NSLock() | |
private var observers: [NSKeyValueObservation] = [NSKeyValueObservation]() |
This file contains 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 Foundation | |
// Inspired by https://gist.github.com/mbuchetics/c9bc6c22033014aa0c550d3b4324411a | |
struct JSONCodingKeys: CodingKey { | |
var stringValue: String | |
init?(stringValue: String) { | |
self.stringValue = stringValue | |
} |
This file contains 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 | |
# | |
# Prune local tracking branches that have been removed upstream. | |
# Your remote tracking branches can be removed automatically by setting `fetch.prune` to true or running `git fetch -prune`. | |
# Another command to clean up your remote tracking branches is `git remote prune <remote>`. | |
# | |
# Author: @leshill | |
# https://gist.github.com/leshill/9a1088a17f94cef24831 | |
if [[ $# = 1 && $1 == '-n' ]]; then |
This file contains 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 | |
## Packages: | |
# brew install pngcrush | |
# brew install optipng | |
# brew install advancemame | |
# brew install https://raw.github.com/adamv/homebrew-alt/23f9084410476da1fcaf946f24f4dde47fe888ea/non-free/pngout.rb | |
function usage { | |
echo "Usage: $0 infile outfile" |
This file contains 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
!!! 5 | |
/[if lt IE 7] <html lang="en" class="no-js ie6"> | |
/[if IE 7 ] <html lang="en" class="no-js ie7"> | |
/[if IE 8 ] <html lang="en" class="no-js ie8"> | |
/[if IE 9 ] <html lang="en" class="no-js ie9"> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> | |
%head | |
%meta{:charset => "utf-8"}/ | |
/ | |
Always force latest IE rendering engine (even in intranet) & Chrome Frame |
This file contains 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
# 2010-10-01 | |
# | |
# Mac OS X 10.6.3 | |
# Homebrew 0.7 | |
# Xcode 3.2.4 | |
# Git 1.7.3.1 | |
# RVM 1.0.12 | |
# Ruby 1.8.7, 1.9.2 | |
# Passenger 2.2.15 | |
# MySQL 5.1.49 |