- Install homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
- Install XMLStarlet for xml parsing:
brew install xmlstarlet
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
brew install xmlstarlet
--- | |
format_version: 1.1.0 | |
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git | |
app: | |
envs: | |
- BITRISE_PROJECT_PATH: ios/pro_mobile.xcodeproj | |
opts: | |
is_expand: false | |
- BITRISE_SCHEME: pro_mobile | |
opts: |
func measureBlock(_ description: String, numberOfExecutes: Int = 1, block: () -> Void) { | |
let start = DispatchTime.now() | |
for _ in 0..<numberOfExecutes { | |
block() | |
} | |
let end = DispatchTime.now() | |
let nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds | |
let secondsTime = (Double(nanoTime)/1000000000.0) |
extension String{ | |
private func min(numbers: Int...) -> Int { | |
return numbers.reduce(numbers[0], {$0 < $1 ? $0 : $1}) | |
} | |
func distanceFrom(string: String) -> Int{ | |
let x = Array(self.utf16) //convert to a unicode 16 format for comparison | |
let y = Array(string.utf16) | |
//Create the Levenshtein 2d matrix, which has an extra preceeding row and column |
Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
#!/bin/bash | |
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
# https://gist.github.com/foozmeat/5154962 | |
# Peter Steinberger, PSPDFKit GmbH, @steipete. | |
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz. |
//You should pick one style to use consistantly in your project | |
//Lazy Intantiation as a C Macro clearly explaining the concept | |
#define WSM_LAZY(variable, assignment) (variable = variable ?: assignment) | |
//Lazy Intantiation as a C Macro clearly explaining the language syntax used | |
#define WSM_TERNARY(variable, assignment) (variable = variable ?: assignment) | |
//Lazy Intantiation as a semi-operator w/class prefix | |
#define WSM_$(variable, assignment) (variable = variable ?: assignment) |
#!/bin/bash | |
# This script builds the iOS and Mac openSSL libraries | |
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |