Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
I’m available for hire!

Lukas Kubanek lukaskubanek

👋
I’m available for hire!
View GitHub Profile
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 / 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>
@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 {}
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 / 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
@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)'\
View FailableMap.swift
//
// FailableMap.swift
//
// Created by Lukas Kubanek on 06/10/15.
// Copyright © 2015 Lukas Kubanek. All rights reserved.
//
public extension Array {
/// Maps the transform over `self` and if **all** calls return a non-nil result it returns
View OptionalAssignment.swift
// Optional Assignment
infix operator =? { associativity right precedence 90 }
/// Given a variable and an optional value it unwraps the optional value
/// and if it is non-nil it assigns the value to the variable. If the value
/// is nil it does nothing.
public func =? <T>(inout variable: T, optionalValue: T?) {
if let value = optionalValue {
variable = value
View swift-3-wishes.md

My Wishes for Swift 3.0

  • Typed errors
  • Property observers from outside as a replacement for KVO
  • Resolving the limitation in failable class initializers which require setting all stored properties before throwing an error or returning nil
  • Operator for reversed ranges (https://medium.com/@icex33/boundary-extension-in-swift-1f577af1aaa)
  • Nested types in generic types
  • Packages (inside frameworks, allowing cyclic dependencies)
  • Members for protocols tied to the protocol type (e.g. for implementing factories on the protocol types)
  • Abstract classes & class methods
@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