Skip to content

Instantly share code, notes, and snippets.

View odrobnik's full-sized avatar

Oliver Drobnik odrobnik

View GitHub Profile
@odrobnik
odrobnik / gist:5398597
Created April 16, 2013 18:59
DTLoupe.podspec
Pod::Spec.new do |spec|
spec.name = 'DTLoupe'
spec.version = '1.3.0'
spec.platform = :ios, '4.3'
spec.license = 'COMMERCIAL'
spec.source = { :git => 'git@git.cocoanetics.com:parts/dtloupe.git', :tag => spec.version.to_s }
spec.source_files = 'Core/Source/*.{h,m}'
spec.frameworks = 'QuartzCore'
spec.requires_arc = true
spec.homepage = 'http://www.cocoanetics.com/parts/dtloupeview/'
@odrobnik
odrobnik / gist:5309752
Created April 4, 2013 11:49
Pictures at URL
- (NSArray *)_picturesInDirectoryAtURL:(NSURL *)URL
{
NSMutableArray *tmpArray = [NSMutableArray array];
NSArray *keys = [NSArray arrayWithObjects:
NSURLIsDirectoryKey, NSURLIsPackageKey, NSURLLocalizedNameKey, nil];
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager]
enumeratorAtURL:URL
includingPropertiesForKeys:keys
@odrobnik
odrobnik / gist:5091275
Created March 5, 2013 15:53
Unable to create an issue with this text:
DTHTMLWriter does not correctly encode emoji unicode sequences.
It outputs this:
Here is a Smiley: �� and Mr. Poop: ��
which does not display as Emoji in Safari.
NSHTMLWriter does not encode them at all:
@odrobnik
odrobnik / log.txt
Created January 23, 2013 15:48
log.txt
commit 82ad4f93ebf956ab4e06a746bb408c536f0544cd
Merge: 85ba3f7 a5d6b82
Author: Oliver Drobnik <oliver@cocoanetics.com>
Date: Wed Jan 23 16:10:30 2013 +0100
Merge branch 'master' of github.com:Cocoanetics/DTFoundation
commit a5d6b825e721a2d26dca70eadbffd4659d5fe604
Merge: f43764c c6cdd6e
Author: gugmaster <stefan@cocoanetics.com>
Pod::Spec.new do |spec|
spec.name = 'DTFoundation'
spec.version = '1.0.0'
spec.summary = "Standard toolset classes and categories."
spec.homepage = "https://github.com/Cocoanetics/DTFoundation"
spec.author = { "Oliver Drobnik" => "oliver@drobnik.com" }
spec.source = { :git => "https://github.com/Cocoanetics/DTFoundation.git", :tag => spec.version.to_s }
spec.license = 'BSD'
spec.requires_arc = true
@odrobnik
odrobnik / gist:4181256
Created December 1, 2012 09:20
Tweetbot re-auth bug
Bug Report: Tweetbot fails to sign in for retweet from other account after restore from iCloud
Steps to Reproduce:
1) Have Tweetbot set up for multiple Twitter accounts
2) backup to iCloud
3) reset device and restore from iCloud
4) open Tweetbot, when prompted re-authorize first account
5) in timeline of first account retweet something via the second account
6) Tweetbot wants to re-authorize the second account
@odrobnik
odrobnik / gist:4086204
Created November 16, 2012 10:20
Forwarding keydown event to a search field
- (void)goToProductListWithEvent:(NSEvent *)event
{
self.selectedViewController = _productListViewController;
// make the search bar first responder
NSWindow *window = self.view.window;
[window makeFirstResponder:_productListViewController.searchField];
// set the keyDown character into the search field
_productListViewController.searchField.stringValue = [event characters];
@odrobnik
odrobnik / gist:4060573
Created November 12, 2012 17:09
Comparing URLs
NSURL *a = [NSURL URLWithString:@"http://google.com/oliver.html"];
NSURL *b = [NSURL URLWithString:@"oliver.html" relativeToURL:[NSURL URLWithString:@"http://google.com"]];
if([a isEqual:b]) {
NSLog(@"Same"); // Not run
}
if([[a absoluteURL] isEqual:[b absoluteURL]]) {
NSLog(@"Same"); // Still not run
}
#pragma mark - Undo Support
- (void)addUndoObservers
{
for (CatalogPage *onePage in _catalog.pages)
{
NSArray *undoableHotZoneKeys = [CatalogPageHotZone undoableKeys];
for (CatalogPageHotZone *oneHotZone in onePage.hotZones)
{
@odrobnik
odrobnik / gist:3811844
Created October 1, 2012 13:37
Modally presenting a sheet/panel the UIKit style
//
// NSWindow+DTViewControllerPresenting.m
// DTFoundation
//
// Created by Oliver Drobnik on 10/1/12.
// Copyright (c) 2012 Cocoanetics. All rights reserved.
//
#import "objc/runtime.h"