Skip to content

Instantly share code, notes, and snippets.

Avatar

Lukas Kubanek lukaskubanek

View GitHub Profile
View AppDelegate.swift
//
// AppDelegate.swift
// SwiftStructsMemoryLeak
//
// Created by Lukas Kubanek on 03/06/15.
// Copyright (c) 2015 Lukas Kubanek. All rights reserved.
//
import Cocoa
@lukaskubanek
lukaskubanek / Test.swift
Last active Aug 29, 2015
Swift: Conformance to a base class and a protocol
View Test.swift
class BaseClass {}
protocol Protocol {}
class Container<T where T: BaseClass, T: Protocol> {
var array: [T] = []
}
class FirstConformClass: BaseClass, Protocol {}
class SecondConformClass: BaseClass, Protocol {}
@lukaskubanek
lukaskubanek / CustomView.h
Created Jun 17, 2014
Replacing the class to subclass after loading a custom view from Interface Builder
View CustomView.h
//
// CustomView.h
// IBSubclassTest
//
// Created by Lukas Kubanek on 17.06.2014.
// Copyright (c) 2014 Lukas Kubanek. All rights reserved.
//
#import <UIKit/UIKit.h>
View keybase.md

Keybase proof

I hereby claim:

  • I am lukaskubanek on github.
  • I am lukaskubanek (https://keybase.io/lukaskubanek) on keybase.
  • I have a public key whose fingerprint is AC27 FB71 EDA6 37A4 2EB7 DCDC 6989 2B39 12E3 D15A

To claim this, I am signing this object:

@lukaskubanek
lukaskubanek / gist:8482546
Created Jan 17, 2014
This is an exception thrown by AppKit when clicked on the main menu and having set a breakpoint in the workspace for all thrown exceptions.
View gist:8482546
* thread #1: tid = 0x607f3, 0x00007fff85321e4a libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #0: 0x00007fff85321e4a libobjc.A.dylib`objc_exception_throw
frame #1: 0x00007fff8aa83e09 CoreFoundation`-[NSException raise] + 9
frame #2: 0x00007fff84845610 AppKit`NSAccessibilityAttributeValue + 118
frame #3: 0x00007fff84b41481 AppKit`-[NSObject(NSAccessibilityInternal) _accessibilityValueForAttribute:clientError:] + 242
frame #4: 0x00007fff84b5cba4 AppKit`-[NSApplication(NSApplicationAccessibility) _accessibilityValueForAttribute:clientError:] + 50
frame #5: 0x00007fff84b4554d AppKit`CopyAppKitUIElementAttributeValueNoCatch + 50
frame #6: 0x00007fff84b42b19 AppKit`CopyAttributeValue + 358
frame #7: 0x00007fff8abb3281 HIServices`_AXXMIGCopyAttributeValue + 255
frame #8: 0x00007fff8abbc58c HIServices`_XCopyAttributeValue + 494
@lukaskubanek
lukaskubanek / disable_undo.m
Created Jan 12, 2014
Disabling undo for a specific operation of Core Data
View disable_undo.m
- (void)method
{
NSUndoManager *undoManager = [self undoManager];
[undoManager disableUndoRegistration];
/* do something */
[self.managedObjectContext processPendingChanges];
[undoManager enableUndoRegistration];
}
@lukaskubanek
lukaskubanek / disable-notification-center.sh
Last active Dec 11, 2015
Disable the Notification Center in Mac OS X using cURL.
View disable-notification-center.sh
#!/bin/sh
# commands taken from http://osxdaily.com/2012/08/06/disable-notification-center-remove-menu-bar-icon-os-x/
# usage: curl -L https://gist.github.com/raw/4529265/eb7df9dcd9bf92ecab978ccc500bd80221565aef/disable-notification-center.sh | sh
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall NotificationCenter
@lukaskubanek
lukaskubanek / _pandoc
Created Oct 22, 2012 — forked from sky-y/_pandoc
Zsh completion for Pandoc
View _pandoc
_pandoc()
{
typeset -A opt_args
local context state line
_arguments -s -S \
'(-f+ --from=+)'{-r+,--read=+}'[Specify input format.]:FORMAT:(native json markdown textile rst html docbook latex)'\
'(-r+,--read=+)'{-f+,--from=+}'[Specify input format.]:FORMAT:(native json markdown textile rst html docbook latex)'\
'(-t+ --to=+)'{-w+,--write=+}'[Specify output format.]:FORMAT:(native json plain markdown rst html html5 latex beamer context man mediawiki textile org texinfo docbook opendocument odt docx epub asciidoc slidy slideous dzslides s5 rtf)'\
'(-w+ --write=+)'{-t+,--to=+}'[Specify output format.]:FORMAT:(native json plain markdown rst html html5 latex beamer context man mediawiki textile org texinfo docbook opendocument odt docx epub asciidoc slidy slideous dzslides s5 rtf)'\
@lukaskubanek
lukaskubanek / git-flow-lightning-talk.sh
Created May 10, 2012
Resources for my lightning talk "Git Flow - A Successful Branching Model"
View git-flow-lightning-talk.sh
#!/bin/bash
# Git Flow - A Successful Branching Model
# Resources for my lightning talk at WDCM Dresden on 10.05.2012 (http://wdcmdresden.com/14-lightning-talks/)
# Created by Lukas Kubanek (@kubanek_l)
# What is Git?
open "http://git-scm.com/" # New official Git website
open "http://wdcmdresden.com/8-git" # Git meeting where I held a talk about Git
open "http://try.github.com" # Git tutorial