Skip to content

Instantly share code, notes, and snippets.

View lukaskubanek's full-sized avatar

Lukas Kubanek lukaskubanek

View GitHub Profile
@lukaskubanek
lukaskubanek / NSBezierPath+CGPath.swift
Created June 14, 2015 08:19
NSBezierPath+CGPath.swift
import AppKit
public extension NSBezierPath {
public convenience init(path: CGPath) {
self.init()
let pathPtr = UnsafeMutablePointer<NSBezierPath>.alloc(1)
pathPtr.initialize(self)
//
// 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 August 29, 2015 14:13
Swift: Conformance to a base class and a protocol
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 June 17, 2014 09:57
Replacing the class to subclass after loading a custom view from Interface Builder
//
// CustomView.h
// IBSubclassTest
//
// Created by Lukas Kubanek on 17.06.2014.
// Copyright (c) 2014 Lukas Kubanek. All rights reserved.
//
#import <UIKit/UIKit.h>
@lukaskubanek
lukaskubanek / keybase.md
Created June 15, 2014 19:36
Keybase proof

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 / disable_undo.m
Created January 12, 2014 21:46
Disabling undo for a specific operation of Core Data
- (void)method
{
NSUndoManager *undoManager = [self undoManager];
[undoManager disableUndoRegistration];
/* do something */
[self.managedObjectContext processPendingChanges];
[undoManager enableUndoRegistration];
}
@lukaskubanek
lukaskubanek / disable-notification-center.sh
Last active December 11, 2015 02:18
Disable the Notification Center in Mac OS X using cURL.
#!/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 October 22, 2012 21:59 — forked from sky-y/_pandoc
Zsh completion for 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 12:01
Resources for my lightning talk "Git Flow - A Successful Branching Model"
#!/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