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
public extension NSLayoutConstraint.Priority { | |
public static func -(lhs: NSLayoutConstraint.Priority, rhs: Float) -> NSLayoutConstraint.Priority { | |
return NSLayoutConstraint.Priority(lhs.rawValue - rhs) | |
} | |
public static func +(lhs: NSLayoutConstraint.Priority, rhs: Float) -> NSLayoutConstraint.Priority { | |
return NSLayoutConstraint.Priority(lhs.rawValue + rhs) | |
} | |
} |
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] | |
delete-merged = !bash -c '\ | |
REMOTE=$1 && \ | |
REMOTE=${REMOTE:="origin"} && \ | |
echo "Fetching $REMOTE" && \ | |
git fetch $REMOTE --prune && \ | |
git branch -vv | grep "gone]" | awk \"{ print \\$1 }\" | xargs git branch -d' - | |
# usage: `git delete-merged` |
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
enum Thing { | |
case empty | |
case int(Int) | |
} | |
let things: [Thing] = [.empty, .int(3), .int(7)] | |
// Surely there's a more concise way to write this `filter` closure? | |
let intThings = things.filter({ | |
if case Thing.int = $0 { return true } |
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
// | |
// ContentView.swift | |
// SwiftUIPlayground | |
// | |
// Created by BJ Homer on 4/26/21. | |
// | |
import SwiftUI | |
OlderNewer