Skip to content

Instantly share code, notes, and snippets.

View joncardasis's full-sized avatar
🔬
📱 Probing iOS internals...

Jon Cardasis joncardasis

🔬
📱 Probing iOS internals...
View GitHub Profile
@joncardasis
joncardasis / obtain_public_key.md
Created August 10, 2017 19:55
Obtain Public Key from iOS .mobileprovision profile
  1. Install homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
  1. Install XMLStarlet for xml parsing:
brew install xmlstarlet
@PillowUnicorn
PillowUnicorn / ios-bitrise.yml
Created April 28, 2017 22:29
Pillow's iOS bitrise.yml
---
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:
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active May 4, 2024 14:06
React Native Bridging Cheatsheet
@joncardasis
joncardasis / Measure.swift
Last active January 26, 2018 00:26
My Swift 3 Measure Execution time function using GCD
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)
@joncardasis
joncardasis / String+Levenshtein.swift
Last active December 12, 2016 19:24
Levenshtein Algorithm in Swift 3 - Calculates the number of differences between two strings
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
@acrookston
acrookston / README.md
Last active January 26, 2022 11:05
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

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

@felix-schwarz
felix-schwarz / openssl-build.sh
Last active March 19, 2024 03:16 — forked from steipete/openssl-build.h
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
#!/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.
@rismay
rismay / WSMMacros.h
Created January 25, 2014 20:13
Lazy Instantiation as a C MACRO
//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)
@foozmeat
foozmeat / openssl-build.sh
Last active May 22, 2024 17:56
A shell script to build openssl for iOS and Mac. It currently builds: Mac -> i386 & x86_64 // iOS -> armv7, arm64 // iOS Simulator -> i386 & x86_64.
#!/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