Skip to content

Instantly share code, notes, and snippets.

View KrauseFx's full-sized avatar
🚀
shipping

Felix Krause KrauseFx

🚀
shipping
View GitHub Profile
static FMDatabaseQueue *_queue;
static NSOperationQueue *_writeQueue;
static NSRecursiveLock *_writeQueueLock;
_queue = [FMDatabaseQueue databaseQueueWithPath:...];
_writeQueue = [NSOperationQueue new];
[_writeQueue setMaxConcurrentOperationCount:1];
_writeQueueLock = [NSRecursiveLock new];
[_writeQueueLock lock];
[_queue inDatabase:^(FMDatabase *db) {
FMResultSet *res = [db executeQuery:@"..."];
if ([res next]) {
...
}
[res close];
}];
[_writeQueueLock unlock];
[_writeQueue addOperationWithBlock:^{
[_writeQueueLock lock];
[_queue inDatabase:^(FMDatabase *db) {
if (![db executeUpdate:@"..." withArgumentsInArray:...]) { ... }
}];
[_writeQueueLock unlock];
}];
@KrauseFx
KrauseFx / DeviceSwitcherForSubliminal.rb
Created November 1, 2014 16:35
This script runs through all the devices and generates a HTML page, viewing all the images
require 'JSON'
class Runner
def Runner.run
system("xcodebuild clean")
config = {
"devices": [
"iPhone 6 Plus (8.1 Simulator)",
"iPhone 6 (8.1 Simulator)",
@KrauseFx
KrauseFx / Lanes.rb
Created January 9, 2015 14:40
Lanes
before_all do
increment_build_number
cocoapods
xctool :test
end
lane :beta do
sigh :adhoc
deliver :beta
hockey
@KrauseFx
KrauseFx / Multiple Schemes Deliver.rb
Created November 13, 2014 19:34
Multiple Schemes in deliver
project_name = gets.chomp
if project_name == 'project_name1'
email "yourappleid@company.com"
# hide_transporter_output # remove the '#' in the beginning of the line, to hide the output while uploading
########################################
# App Metadata
########################################

Keybase proof

I hereby claim:

  • I am KrauseFx on github.
  • I am krausefx (https://keybase.io/krausefx) on keybase.
  • I have a public key whose fingerprint is 179F 4EFF D4C4 35ED 7F21 5F2D F4F0 E47F 5C75 4D85

To claim this, I am signing this object:

Test Suite 'All tests' started at 2015-06-18 14:48:42.601
Test Suite 'TempCam UI Tests.xctest' started at 2015-06-18 14:48:42.602
Test Suite 'TempCam_UI_Tests' started at 2015-06-18 14:48:42.602
Test Case '-[TempCam_UI_Tests.TempCam_UI_Tests testExample]' started.
2015-06-18 14:48:43.676 XCTRunner[39404:602329] Continuing to run tests in the background with task ID 1
t = 1.99s Wait for app to idle
t = 2.63s Find the "toggleButton" Switch
t = 2.65s Tap the "toggleButton" Switch
t = 2.65s Wait for app to idle
t = 2.66s Find the "toggleButton" Switch
@KrauseFx
KrauseFx / get_identifier_to_be_uploaded.rb
Created September 2, 2014 08:45
iTunesConnect: Receive the app identifier of the next app to be uploaded (Waiting for Upload status), since you can not specify which app you want to deploy next (http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line#comment23525642_7569194)
# encoding: utf-8
require 'pty'
require 'pry'
command = "xcrun -sdk iphoneos Validation -online -upload -verbose notHere.ipa"
# upload it now: http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line
output = ''
begin