start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/sh | |
| # ugh.sh | |
| # | |
| # | |
| # Created by Andrew McKnight on 11/27/14. | |
| # | |
| # UGH: uncrustify git history. | |
| # Creates a new branch and cherry picks a range of commits, uncrustifying any modified .h/.m files. |
| #!/bin/sh | |
| git log --graph --full-history --all --color \ | |
| --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s" |
| #!/bin/sh | |
| # | |
| # install_xcode.sh | |
| # | |
| # Created by Andrew McKnight on 9/24/15 | |
| # | |
| # takes a downloaded .dmg containing Xcode and installs it to a specified location/name, or defaults to /Applications and the DMG's filename | |
| # |
| #!/bin/sh | |
| # | |
| # deploy_xcode.sh | |
| # | |
| # Created by Andrew McKnight on 9/24/15. | |
| # | |
| # takes a local copy of a downloaded Xcode .dmg and install_xcode.sh and copies them to a collection of remote machines, and runs the install script on each | |
| # |
| curl --silent -X "GET" "https://api.github.com/orgs/<org>/repos" -H "Accept: application/vnd.github.v3+json" -u <github-username>:<access-token> | grep ssh_url | awk '{ print $2 }' | tr -d \"\, | xargs -I {} git clone {} --recurse-submodules |
| /** | |
| General description of the thing being documented. You can use: | |
| - markdown-style `backticks` | |
| - [urls pointing to pages like this one, that really helped me make this (thanks!)](http://ericasadun.com/2015/06/14/swift-header-documentation-in-xcode-7/) (also, see the [official docs from Apple's Swift repo](https://github.com/swiftlang/swift/blob/main/docs/DocumentationComments.md)) | |
| - HTML-style ascii codes (see copyright below) | |
| # Headers (or, underline with an \=) | |
| ## work (or, underline with a \-) | |
| ##### too (there is no alternative to level 3 header syntax) |
| public func snappedAngle(snappingAngle: Angle) -> Angle { | |
| if snappingAngle.radians == 0 { | |
| return self | |
| } | |
| let interval = Int(degrees / (snappingAngle.degrees / 2)) | |
| if interval == 0 { | |
| return .zero | |
| } else if interval == Int(360 / (snappingAngle.degrees / 2) - 1) { |
| extension String { | |
| func indexOfClosestSorted(toValue value: Degree) -> Int { | |
| var smallestDifference = last! | |
| var closestIntervalAngleIdx = 0 | |
| for i in 0 ..< count { | |
| let closestValueCandidate = self[i] | |
| var difference = fabs(closestValueCandidate - value) | |
| if difference == 0 { |
| extension String where Element: Strideable { | |
| func fuzzyBinarySearchRecursive(lowerBound: Int = 0, upperBound: Int? = nil, query: Element) -> Int { | |
| let resolvedUpperBound = upperBound ?? count - 1 | |
| if lowerBound == resolvedUpperBound { | |
| return lowerBound | |
| } | |
| if lowerBound == resolvedUpperBound - 1 { |