CLICK ME
yes, even hidden code blocks!
print("hello world!")
#!/usr/bin/swift | |
import Foundation | |
func scanForRepositories(directory: NSURL, root: NSURL) { | |
let fileManager = NSFileManager.defaultManager() | |
let options: NSDirectoryEnumerationOptions = .SkipsSubdirectoryDescendants | .SkipsPackageDescendants | |
if let contents = fileManager.contentsOfDirectoryAtURL(directory, includingPropertiesForKeys: [NSURLIsDirectoryKey], options: options, error: nil) { | |
let urls = contents as Array<NSURL> |
#!/bin/bash | |
# A script to automatically switch to another user in macOS | |
# Invoke like this: `autologin.sh {user} {password}` | |
uid=`id -u $1` | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID "$uid" | |
osascript <<EOD |
### Keybase proof | |
I hereby claim: | |
* I am davedelong on github. | |
* I am davedelong (https://keybase.io/davedelong) on keybase. | |
* I have a public key ASBPhXPG-DfGDYTWePezV32Zhv_iOJVF2cqJVVvmtzdCHQo | |
To claim this, I am signing this object: |
public extension Collection { | |
func keyedBy<T>(_ keyer: (Iterator.Element) -> T?) -> Dictionary<T, Iterator.Element> { | |
var d = Dictionary<T, Iterator.Element>() | |
for item in self { | |
if let key = keyer(item) { | |
d[key] = item | |
} | |
} | |
return d |
on setDarkMode(shouldBeDark) | |
set paneID to "com.apple.preference.general" | |
tell application "System Events" | |
if dark mode of appearance preferences is shouldBeDark then return | |
end tell | |
set paneWasOpen to false | |
// obviously, we'll need a japanese calendar | |
let jp = Calendar(identifier: .japanese) | |
// this is a date formatter that, when formatting a date, gives us the full readable name of the date's era | |
let jpf = DateFormatter() | |
// see also: https://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns | |
jpf.dateFormat = "GGGG" | |
jpf.calendar = jp | |
// ranges are numbered starting at 0 |
# Automatically increment the CFBundleVersion in release builds | |
config=${CONFIGURATION} | |
if [ "${config}" = "Release" ]; then | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" | |
else | |
echo "info: Skipping build number incrementation in ${config} mode" |
fileprivate let tileBaseH = Array(""" | |
┏━━┳━━┓ | |
┃ ┃ ┃ | |
┗━━┻━━┛ | |
""") | |
fileprivate let tileBaseV = Array(""" | |
┏━━┓ | |
┃ ┃ | |
┣━━┫ |