Skip to content

Instantly share code, notes, and snippets.

//: Playground - noun: a place where people can play
import UIKit
// Self
protocol OwlType {
func hootWithOwlType(owl: Self)
}
@alonecuzzo
alonecuzzo / extensions.swift
Created January 23, 2016 00:17
Style with extensions
//
// ViewController.swift
// Styles
//
// Created by Jabari Bell on 1/22/16.
// Copyright © 2016 Jabari Bell. All rights reserved.
//
import UIKit
@alonecuzzo
alonecuzzo / polish.swift
Created January 5, 2016 06:07
WIP for polish notation
//: Playground - noun: a place where people can play
import UIKit
//"2+3+4"
//"234++"
func polish(input: String) -> String {
@alonecuzzo
alonecuzzo / omfg.swift
Created December 28, 2015 20:20
so lost
//
// StopService.swift
// MetroBurb
//
// Created by Jabari Bell on 10/26/15.
// Copyright © 2015 Code Mitten. All rights reserved.
//
import Foundation
import RxSwift
class CustomTableHeaderView: UIView {
//MARK: Property
let label = UILabel(frame: CGRectZero)
let backbutton = UIButton(frame: CGRectZero)
//MARK: Method
override init(frame: CGRect) {
super.init(frame: frame)
import UIKit
import SnapKit
import RxSwift
import RxCocoa
enum CustomPlaceTableViewCellType {
case PlaceName, StreetAddress, City, State, ZipCode
var placeHolder: String {
switch self {
@alonecuzzo
alonecuzzo / Header.swift
Created November 16, 2015 23:47
Get HeaderView Sized with SnapKit
//
// ViewController.swift
// SnapKitTest
//
// Created by Robert Payne on 10/11/15.
// Copyright © 2015 Zwopple Limited. All rights reserved.
//
import SnapKit
import UIKit
@alonecuzzo
alonecuzzo / RAC.swift
Created August 20, 2015 19:24
RAC presentation
import UIKit
import ReactiveCocoa
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
:param: delay The delay before execution.
:param: handler A closure to execute after `delay`.
@alonecuzzo
alonecuzzo / validIndicies.swift
Created August 13, 2015 03:14
Valid Selected Indicies
struct Datasource {
static let _items = ["Cats", "Dogs", "Crows", "Lions", "Owls", "Hawks", "Fish"]
static let items = Datasource._items + Datasource._items
static func validIndiciesForSelectedIndex(index: Int) -> (Int, Int) {
var offset: Int = 0
@alonecuzzo
alonecuzzo / curry.swift
Last active August 29, 2015 14:27
Curry Swift
//adding without currying
func add(a: Int, b:Int) -> Int {
return a + b
}
//when we use the swift curry form this is what is happening behind the scenes
func addCurry(a: Int) -> (Int -> Int) {