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
- (void)runAsyncOperationWithStartBlock:(void (^)(dispatch_block_t asyncOperationCompletionBlock))startBlock { | |
NSCParameterAssert(startBlock); | |
if (!startBlock) { | |
return; | |
} | |
NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ | |
dispatch_semaphore_t completionSemaphore = dispatch_semaphore_create(0); | |
startBlock(^{ | |
dispatch_semaphore_signal(completionSemaphore); | |
}); |
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
find /Applications \ | |
-path '*Contents/_MASReceipt/receipt' \ | |
-maxdepth 4 -print |\ | |
sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##' |
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
sudo rm -rf /Applications/iTunes.app \ | |
sudo softwareupdate --ignore iTunesX |
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
brew cask list | sed 's/^/cask install /' > Caskfile |
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
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
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
defaults write com.apple.CrashReporter UseUNC 1 |
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
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true |
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
# print entitlemens from app binary | |
codesign -d --entitlements :- "Payload/YourApp.app" | |
# print entitlements from provisioning profile | |
security cms -D -i "Payload/YourApp.app/embedded.mobileprovision" |
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
//: Convert an NSRange from NSString into a Range<String.Index> | |
import Foundation | |
let swiftString: String = "🤖 This is an über-👍 string" | |
let swiftStringCharCount = swiftString.characters.count | |
let nsString = (swiftString as NSString).decomposedStringWithCanonicalMapping as NSString | |
let nsStringLength = nsString.length |
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
alias gfd='git fetch origin develop:develop' |
OlderNewer