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 valid = ["3.14159265", "123.12", "2", "56754", "92929292929292.12", "0.21", "3.1","3","-3","0","0.0","1.0","0.1", ".12", "-12", "-34.6"] | |
| let invalid = ["e666.76","a"," ","-"," -1","--1", "2..3", "2-", "2...3", "2.4.3", "5-6-7"] | |
| func isValidNumber(numberString: String) -> Bool { | |
| let numberFormatter = NumberFormatter() | |
| // print(numberFormatter.decimalSeparator) | |
| let decimalSeparator = numberFormatter.decimalSeparator ?? "." | |
| let regularExpression = "[+-]?((\\d+(\\\(decimalSeparator)\\d*)?)|(\\\(decimalSeparator)\\d+))" | |
| // print(regularExpression) |
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 bpy | |
| bl_info = { | |
| "name": "Unity Tools", | |
| "author": "Karol \"Mirgar\" GΕaΕΌewski", | |
| "version": (1, 0, 2), | |
| "blender": (2, 6, 5), | |
| "location": "3D View > Tool Shelf > Unity Tools", | |
| "description": "Tools to ease workflow with Unity Engine", | |
| "warning": "", |
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
| from: http://stackoverflow.com/a/35631022/667834 | |
| $ brew install youtube-dl | |
| $ youtube-dl --list-formats https://www.youtube.com/watch\?v\=[YouTube video id] | |
| shows something like: | |
| .... | |
| 91 mp4 144p HLS , h264, aac @ 48k |
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
| Vapor Example | |
| https://github.com/vapor/example | |
| Will vapor run on this swift version: | |
| $ curl -sL check.qutheory.io | bash | |
| Install vapor toolbox: | |
| https://github.com/qutheory/vapor-toolbox | |
| $ brew install vapor/tap/toolbox |
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
| # Add a carthage Cartfile | |
| github "username/Project" ~> 1.0 | |
| git "https://github.com/username/Project.git" "branch" | |
| # Update carthage | |
| carthage update --platform ios | |
| # Run script | |
| /usr/local/bin/carthage copy-frameworks | |
| $(SRCROOT)/Carthage/Build/iOS/[framework] |
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
| Hub framework | |
| https://spotify.github.io/HubFramework/ | |
| Reactive Swift | |
| https://github.com/ReactiveX/RxSwift | |
| Viper | |
| https://www.objc.io/issues/13-architecture/viper/ | |
| http://mutualmobile.github.io/blog/2013/12/04/viper-introduction/ |
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://developer.apple.com/swift/blog/?id=37 | |
| β https://oleb.net/blog/2016/09/swift-3-ranges/ | |
| β https://my.pcloud.com/publink/show?code=XZdKqsZBfty39EC0uFccqHQwv4FQLwlrNf7 | |
| β https://medium.com/airbnb-engineering/introducing-the-airbnb-imessage-app-806f48d303a8#.i3th9ccue | |
| β https://www.raizlabs.com/dev/2016/09/preparing-ios-app-for-extensions/ | |
| β https://sandofsky.com/blog/singletons.html | |
| β http://blog.benjamin-encz.de/post/declarative-api-design-in-swift/ | |
| β http://nsakaimbo.me/ | |
| β http://khanlou.com/2016/10/slicing/ |
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
| // Objective-c categories with properties. | |
| // | |
| // Taken from: | |
| // http://stackoverflow.com/a/22812632/667834 | |
| // http://stackoverflow.com/a/16020927/667834 | |
| // http://stackoverflow.com/a/11529511/667834 | |
| // | |
| #define CATEGORY_PROPERTY_GET(type, property) \ | |
| - (type) property { return objc_getAssociatedObject(self, @selector(property)); } |
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
| // vector to radians | |
| let radian = atan2(vector.y, vector.x) | |
| // difference between two vectors | |
| let difference = CGFloat.pi2 - abs(abs(radian1 - radian2) - CGFloat.pi2) |
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
| // | |
| // CGHelpers.swift | |
| // | |
| // Created by Richard Adem on 6/21/16. | |
| // Copyright Β© 2016 Richard Adem. All rights reserved. | |
| // | |
| // Lerp and Clamp from Daniel Clelland https://github.com/dclelland/Lerp | |
| import CoreGraphics |