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
| let path = UIBezierPath() | |
| // Apple | |
| path.move(to: CGPoint(x: 110.89, y: 99.2)) | |
| path.addCurve(to: CGPoint(x: 105.97, y: 108.09), controlPoint1: CGPoint(x: 109.5, y: 102.41), controlPoint2: CGPoint(x: 107.87, y: 105.37)) | |
| path.addCurve(to: CGPoint(x: 99.64, y: 115.79), controlPoint1: CGPoint(x: 103.39, y: 111.8), controlPoint2: CGPoint(x: 101.27, y: 114.37)) | |
| path.addCurve(to: CGPoint(x: 91.5, y: 119.4), controlPoint1: CGPoint(x: 97.11, y: 118.13), controlPoint2: CGPoint(x: 94.4, y: 119.33)) | |
| path.addCurve(to: CGPoint(x: 83.99, y: 117.59), controlPoint1: CGPoint(x: 89.42, y: 119.4), controlPoint2: CGPoint(x: 86.91, y: 118.8)) | |
| path.addCurve(to: CGPoint(x: 75.9, y: 115.79), controlPoint1: CGPoint(x: 81.06, y: 116.39), controlPoint2: CGPoint(x: 78.36, y: 115.79)) | |
| path.addCurve(to: CGPoint(x: 67.58, y: 117.59), controlPoint1: CGPoint(x: 73.31, y: 115.79), controlPoint2: CGPoint(x: 70.54, y: 116.39)) |
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
| import XCTest | |
| extension XCTestCase { | |
| func assertFailScreenshot(_ closure: @autoclosure () -> Bool, message: String? = nil, file: String = #file, line: UInt = #line, function: String = #function) { | |
| if !closure() { | |
| takeScreenshot(description: message, file: file, line: line, function: function) | |
| if let message = message { | |
| XCTFail(message) | |
| } else { | |
| XCTFail() |
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
| import Foundation | |
| import FuntastyKit | |
| import PromiseKit | |
| import Photos | |
| import Vision | |
| import QuartzCore | |
| protocol ImageClassificationService: Service { | |
| func classify(asset: PHAsset) -> Promise<String> |
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
| // This widgets show approximate value of your music collection on discogs.com | |
| // and the last addition to the collection in the background. | |
| // Configuration: | |
| // Your Discogs personal token generated here: https://www.discogs.com/settings/developers | |
| let token = "..." | |
| // Your Discogs username | |
| let username = "..." | |
| // Widget: |
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
| // | |
| // Nibable.swift | |
| // | |
| // Created by Matěj Kašpar Jirásek on 12/08/16. | |
| // Copyright © 2016 Matěj Kašpar Jirásek. All rights reserved. | |
| // | |
| import UIKit | |
| protocol Nibable { |
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
| #!/bin/bash | |
| # Decompress all files (only some are compressed, primarily the newer ones) | |
| for filename in *.gz | |
| do | |
| gzip -d $filename | |
| done | |
| # Convert all from GPX to GeoJSON | |
| for filename in *.gpx | |
| do | |
| togeojson $filename > geojsons/$filename.geojson |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Shadow test</title> | |
| <style type="text/css"> | |
| #paper-stack1{ | |
| position: absolute; | |
| top:100px; | |
| left:100px; | |
| width: 100px; |
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
| /// https://sqlite.org/rescode.html | |
| enum ResultCode: Int { | |
| /// The SQLITE_OK result code means that the operation was successful and that there were no errors. Most other result codes indicate an error. | |
| case ok = 0 | |
| /// The SQLITE_ERROR result code is a generic error code that is used when no other more specific error code is available. | |
| case error = 1 | |
| /// The SQLITE_INTERNAL result code indicates an internal malfunction. In a working version of SQLite, an application should never see this result code. If application does encounter this result code, it shows that there is a bug in the database engine. | |
| /// |
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
| /// Lift operator (instance to function, function to function with one more parameter, key-path to function) | |
| /// This operator is similar to `const` function from Haskell. | |
| prefix operator ^ | |
| /// Lift instance to function returning constant result. | |
| @inline(__always) | |
| prefix func ^ <T>(instance: @autoclosure @escaping () -> T) -> () -> T { | |
| return instance | |
| } |
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
| // Set duration for single animation | |
| let duration: TimeInterval = 2 | |
| // Enumerate all the layers | |
| layers.enumerated().forEach { offset, layer in | |
| // Create animation for each layer | |
| let animation = CABasicAnimation(keyPath: "strokeEnd") | |
| // Begin each animation after the one before | |
| animation.beginTime = duration * CFTimeInterval(offset) + delay | |
| animation.toValue = 1 | |
| animation.duration = duration |
NewerOlder