Skip to content

Instantly share code, notes, and snippets.

View odrobnik's full-sized avatar

Oliver Drobnik odrobnik

View GitHub Profile
@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
@odrobnik
odrobnik / gist:6695920
Created September 25, 2013 06:42
iOS 7 power assertion crash
Incident Identifier: 1C50164A-D012-469B-A5E4-675164AD4AC8
CrashReporter Key: 10d06614c22e25053f76586bd110cdfa0ced43f0
Date: 2013-09-25 07:48:20 +0200
OS Version: iPhone OS 7.0 (11A465)
mediaserverd: com.apple.audio.AudioSession-136(com.apple.podcasts).isplaying NoIdleSleepAssertion == 255, held for 00:16:43
mediaserverd: com.apple.audio.VAD Aggregate Device UID 2.isrunning NoIdleSleepAssertion == 255, held for 00:17:01
SpringBoard: com.apple.springboard.idle NoIdleSleepAssertion == 255, held for 00:01:44
backboardd: MobileSafari[142]-com.apple.mobilesafari.AppSuspensionMemoryCleanupTask [0x16d30800]/com.apple.mobilesafari.TabDocumentResourceLoadTask [0x16d31230] NoIdleSleepAssertion == 255, held for 00:01:36
backboardd: Podcasts[136]-Called by iTunesStoreUI, from <redacted> [0x16e59330]/com.apple.storebookkeeper-Podcasts-<IMAsynchronousTask: 0x192d7ab0> 'MZUPPStore Synchronize' [0x16d51660]/136 [0x16d32e20]/com.apple.StoreServices.SSSQLiteDatabase [0x16e4bf10] NoIdleSleepAssertion
@implementation DTProgressReportingURLProtocol
{
NSURLConnection *_connection;
dispatch_semaphore_t _semaphore;
}
+ (BOOL)canInitWithRequest:(NSURLRequest *)request
{
NSLog(@"%@", [self propertyForKey:@"UserAgentSet" inRequest:request]);
@odrobnik
odrobnik / gist:6421605
Created September 3, 2013 09:26
Why does setting the diameter cause the size to go to {0,0}?
@implementation ExpandButton
{
NSLayoutConstraint *_widthConstraint;
}
- (id)initWithFrame:(CGRect)frame
{
CGFloat smallerDim = MIN(frame.size.height, frame.size.width);
self = [super initWithFrame:frame];
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
CGFloat topInset = 0;
CGFloat bottomInset = 0;
if ([self respondsToSelector:NSSelectorFromString(@"topLayoutGuide")])
{
id topLayoutGuide = [self valueForKeyPath:@"topLayoutGuide"];
(lldb) po [self.view recursiveDescription]
<UIScrollView: 0x8b96320; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x8b990c0>; layer = <CALayer: 0x8b96530>; contentOffset: {0, 0}>
| <_UILayoutGuide: 0x8b96720; frame = (0 0; 0 20); hidden = YES; layer = <CALayer: 0x8b96790>>
| <_UILayoutGuide: 0x8b96ac0; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x8b96b30>>
| <UIImageView: 0x8b98b70; frame = (316.5 561; 3.5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x8b98c50>>
| <UIImageView: 0x8b98330; frame = (313 564.5; 7 3.5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x8b986c0>>
| <ContentView: 0x8b99eb0; frame = (0 0; 2000 2000); layer = <DTTiledLayerWithoutFade: 0x8b95c80>>
(lldb) po self.view.constraints
<__NSArrayM 0x8a67630>(
<_UILayoutSupportConstraint:0x8b96f10 V:[_UILayoutGuide:0x8b96720(20)]>,
@odrobnik
odrobnik / BCKEAN13Code.m
Last active December 20, 2015 20:49
First progress on making a modern EAN13 Barcode generator ...
//
// BCKEAN13Code.m
// BarCodeKit
//
// Created by Oliver Drobnik on 8/9/13.
// Copyright (c) 2013 Oliver Drobnik. All rights reserved.
//
#import "BCKEAN13Code.h"
@odrobnik
odrobnik / AppDelegate.m
Created August 7, 2013 13:35
replacing HTML entities with libxml2's SAX HTML Parser
#import "AppDelegate.h"
#import "ViewController.h"
#import "DTHTMLParser.h"
@interface AppDelegate () <DTHTMLParserDelegate>
@end
@implementation AppDelegate