A layout guide for iOS 10 that is very similar to the safeAreaLayoutGuide
from iOS 11.
extension UIView {
///
private final class LayoutGuide : UILayoutGuide {}
///
var guardedAreaLayoutGuide: UILayoutGuide {
if #available(iOS 11, *) {
import Foundation | |
import SwiftSyntax | |
func main() throws { | |
guard CommandLine.arguments.count > 1 else { | |
print("usage: swift-format [file]") | |
exit(-1) | |
} | |
let url = URL(fileURLWithPath: CommandLine.arguments[1]) |
#!/bin/bash | |
# This a simple bash script to run `cargo clean` recursively. | |
# | |
# Usage: `bash cargo-clean.sh target_dir` | |
clean_recursive() { | |
# First, check whether current directiry is the root of a cargo project. | |
if [ -f "Cargo.toml" ]; then | |
echo "Cleaning \"$(pwd)\"" |
import Foundation | |
extension String { | |
func hyphenated(languageCode: String) -> String { | |
let locale = Locale(identifier: languageCode) | |
return self.hyphenated(locale: locale) | |
} | |
func hyphenated(locale: Locale) -> String { |
A layout guide for iOS 10 that is very similar to the safeAreaLayoutGuide
from iOS 11.
extension UIView {
///
private final class LayoutGuide : UILayoutGuide {}
///
var guardedAreaLayoutGuide: UILayoutGuide {
if #available(iOS 11, *) {
/*: | |
This is an implementation of Algorithm W, as found in [Principal Types for functional programs](http://web.cs.wpi.edu/~cs4536/c12/milner-damas_principal_types.pdf). | |
We'll start by defining literals and expressions: | |
*/ | |
enum Literal { | |
case string(String) | |
case int(Int) |
/// Playground - noun: a place where people can play | |
/// I am the very model of a modern Judgement General | |
//: # Algorithm W | |
//: In this playground we develop a complete implementation of the classic | |
//: algorithm W for Hindley-Milner polymorphic type inference in Swift. | |
//: ## Introduction |
#!/bin/bash | |
# Merge multiple repositories into one big monorepo. Migrates every branch in | |
# every subrepo to the eponymous branch in the monorepo, with all files | |
# (including in the history) rewritten to live under a subdirectory. | |
# | |
# To use a separate temporary directory while migrating, set the GIT_TMPDIR | |
# envvar. | |
# | |
# To access the individual functions instead of executing main, source this |
// | |
// DisplayLink.swift | |
// MetalMac | |
// | |
// Created by Jose Canepa on 8/18/16. | |
// Copyright © 2016 Jose Canepa. All rights reserved. | |
// | |
import AppKit |