Skip to content

Instantly share code, notes, and snippets.

View odrobnik's full-sized avatar

Oliver Drobnik odrobnik

View GitHub Profile
NSUInteger BCKCodeMaxBarScaleThatFitsCodeInSize(BCKCode *code, CGSize size, NSDictionary *options)
{
NSInteger retScale = 1;
NSMutableDictionary *mutableOptions = [NSMutableDictionary dictionaryWithDictionary:options];
for (NSUInteger scale=1;;scale++)
{
mutableOptions[BCKCodeDrawingBarScaleOption] = @(scale);
CGSize neededSize = [code sizeWithRenderOptions:mutableOptions];
@odrobnik
odrobnik / makepass.rb
Last active January 3, 2016 08:19
Working on this to bundle up the files of a pkpass
#!/usr/bin/env ruby
require 'json'
require "openssl"
# use current time as serial number
serialNumber = Time.now.to_i.to_s
eventDate = Time.new(2014, 07, 24, 20, 15, 0, "+02:00")
seat = "1A"
@odrobnik
odrobnik / gist:8102582
Created December 23, 2013 18:57
Schnee-Schoko-Kuchen
1. 9 dag Butter + 9 dag Schokolade schnelzen
2. 5 Eiklar + 9 dag Zucker schlagen
3. 9 dag Mehl griffig unter 1) mischen
4. Schnee aus 2) unter 1) heben
bei 160 Grad Heissluft (oder 180 Grad Ober/Unterhitze) ca. 50 min
[Info] Collecting info for testables... (1397 ms)
run-test UnitTests.octest (iphonesimulator7.0, logic-test, GC OFF)
dyld: could not load inserted library '/usr/local/Cellar/xctool/0.1.10/libexec/lib/otest-shim-ios.dylib' because no suitable image found. Did find:
/usr/local/Cellar/xctool/0.1.10/libexec/lib/otest-shim-ios.dylib: mach-o, but wrong architecture
suite UnitTests.octest_CRASHED
UnitTests.octest_CRASHED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The test binary crashed outside of a running test or test-suite.
CRASH REPORT: otest_2013-11-27-200155_BigDrops.crash
@odrobnik
odrobnik / gist:6988102
Created October 15, 2013 08:00
Weird Crash
ate/Time: 2013-10-14 11:42:09.570 -0700
OS Version: Mac OS X 10.8.5 (12F45)
Report Version: 10
Interval Since Last Report: 595073 sec
Crashes Since Last Report: 1
Per-App Interval Since Last Report: 45 sec
Per-App Crashes Since Last Report: 1
Anonymous UUID: 2009981E-AF47-32A9-CE93-9BCEB9A5C8C9
- (id)initWithFrame:(CGRect)frame attributedString:(NSAttributedString *)attributedString
{
self = [super init];
if (self)
{
_synchQueue = dispatch_queue_create("DTMutableCoreTextLayoutFrame Sync Queue", DISPATCH_QUEUE_CONCURRENT);
}
@odrobnik
odrobnik / gist:6869306
Last active December 24, 2015 21:59
Using NSConditionLock - is this correct?
@implementation DTDrawingLock
{
NSUInteger _numberActiveOperations;
NSConditionLock *_lock;
}
- (instancetype)init
{
self = [super init];
@odrobnik
odrobnik / coveralls2.rb
Created September 30, 2013 15:54
A shorter version that doesn't depend on the build settings
#!/usr/bin/env ruby
require 'etc'
require 'fileutils'
require 'find'
workingDir = Dir.getwd
derivedDataDir = "#{Etc.getpwuid.dir}/Library/Developer/Xcode/DerivedData/"
outputDir = workingDir + "/gcov"
@odrobnik
odrobnik / coveralls.rb
Created September 30, 2013 15:01
my first attempt at a ruby script to gather and process the gcda files... comments and improvements welcome
#!/usr/bin/env ruby
require 'fileutils'
workingDir = Dir.getwd
# get xcode variables
xcodeBuildSettings = `xctool -project DTFoundation.xcodeproj -configuration Coverage -scheme "Static Library" build -sdk iphonesimulator -showBuildSettings`
@odrobnik
odrobnik / gist:6724806
Created September 27, 2013 06:25
Power Assertion Crash
Incident Identifier: 605BD9B1-2F5E-4728-8093-3E7DBCF67560
CrashReporter Key: 10d06614c22e25053f76586bd110cdfa0ced43f0
Date: 2013-09-27 07:44:32 +0200
OS Version: iPhone OS 7.0 (11A465)
mediaserverd: com.apple.audio.AudioSession-769(com.apple.podcasts).isplaying NoIdleSleepAssertion == 255, held for 00:14:12
mediaserverd: com.apple.audio.VAD Aggregate Device UID 16.isrunning NoIdleSleepAssertion == 255, held for 00:14:23
SpringBoard: com.apple.springboard.idle NoIdleSleepAssertion == 255, held for 00:01:26
backboardd: MobileSafari[783]-com.apple.mobilesafari.TabDocumentResourceLoadTask [0x16eb1f00]/com.apple.mobilesafari.TabDocumentResourceLoadTask [0x16ea8ac0]/com.apple.mobilesafari.TabDocumentResourceLoadTask [0x16db9280] NoIdleSleepAssertion == 255, held for 00:00:13
backboardd: Podcasts[769]-769 [0x16e84860] NoIdleSleepAssertion == 255, held for 00:14:26