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 gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from | |
| * a base64 string. | |
| * This code is used in my startup, Zired. | |
| * Web: http://zired.io | |
| */ | |
| // You can either "yarn add aws-sdk" or "npm i aws-sdk" | |
| const AWS = require('aws-sdk') |
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
| extension UIImage { | |
| func fixedOrientation() -> UIImage { | |
| if imageOrientation == UIImageOrientation.Up { | |
| return self | |
| } | |
| var transform: CGAffineTransform = CGAffineTransformIdentity | |
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
| # do not assign the new build number if there is no changes | |
| DIFF=`git diff` | |
| if [[ $DIFF == "" ]]; then exit 0; fi | |
| # path to the property list where the version number should be changed | |
| PLIST="${PROJECT_DIR}/${INFOPLIST_FILE}" | |
| SETTINGSPLIST="Settings.bundle/Information.plist" | |
| # Name of the branch | |
| BRANCH_NAME=`git branch | grep \* | cut -d ' ' -f2` |
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
| // | |
| // crc32.swift | |
| // SuperSFV | |
| // | |
| // Created by C.W. Betts on 8/23/15. | |
| // | |
| // | |
| /* crc32.swift -- compute the CRC-32 of a data stream | |
| Copyright (C) 1995-1998 Mark Adler | |
| Copyright (C) 2015 C.W. "Madd the Sane" Betts |
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
| # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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
| // | |
| // ViewController.swift | |
| // DispatchGroupTest | |
| // | |
| // Created by Julian Bleecker on 12/9/17. | |
| // Copyright © 2017 Near Future Laboratory. All rights reserved. | |
| // | |
| import UIKit |
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
| ## OS X files | |
| .DS_Store | |
| .DS_Store? | |
| .Trashes | |
| .Spotlight-V100 | |
| *.swp | |
| ## Xcode build files | |
| DerivedData/ | |
| build/ |
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
| extension UIImage { | |
| class func imageByCombiningImage(firstImage: UIImage, withImage secondImage: UIImage) -> UIImage { | |
| let newImageWidth = max(firstImage.size.width, secondImage.size.width ) | |
| let newImageHeight = max(firstImage.size.height, secondImage.size.height) | |
| let newImageSize = CGSize(width : newImageWidth, height: newImageHeight) | |
| UIGraphicsBeginImageContextWithOptions(newImageSize, false, UIScreen.mainScreen().scale) |
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
| #toast-container > .toast { | |
| background-image: none !important; | |
| } | |
| #toast-container > .toast:before { | |
| position: fixed; | |
| font-family: FontAwesome; | |
| font-size: 24px; | |
| line-height: 18px; | |
| float: left; |
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
| extension Sequence { | |
| func any(_ predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Bool { | |
| for element in self { | |
| let result = try predicate(element) | |
| if result { | |
| return true | |
| } | |
| } | |
| return false |