This file contains 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 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 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 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 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 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 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 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 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 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 |