Skip to content

Instantly share code, notes, and snippets.

Casey Liss cliss

Block or report user

Report or block cliss

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View IndexPath+RawRepresentable.swift
import UIKit
public typealias RowSectionPair = (row: Int, section: Int)
extension IndexPath: RawRepresentable {
public typealias RawValue = RowSectionPair
public init?(rawValue: RowSectionPair) {
self = IndexPath(row: rawValue.row, section: rawValue.section)
}
@cliss
cliss / IteratorPlayground.swift
Created Dec 18, 2019
Playground contents showing the use of AnyIterator<T>
View IteratorPlayground.swift
import Foundation
class ListOfIntegers: Sequence {
typealias Element = Int
private var backingStore = [Int]()
init() {}
init(_ value: [Int]) {
self.backingStore = value
}
@cliss
cliss / Brewfile
Created Oct 8, 2019
Casey Liss's Brewfile, as of 8 October 2019
View Brewfile
cask_args appdir: "/Applications"
tap "homebrew/cask-fonts"
brew "mas"
mas "1Blocker", id: 1107421413
mas "Day One", id: 1055511498
mas "Deliveries", id: 924726344
mas "Due", id: 524373870
mas "Fantastical", id: 435003921
@cliss
cliss / SearchController.swift
Last active Jun 2, 2017 — forked from irace/SearchController.swift
UISearchController replacement. Relies on a couple of internal categories, helpers, etc.
View SearchController.swift
//
// SearchController.swift
// Prefer
//
// Created by Bryan Irace on 5/31/17.
// Copyright © 2017 Prefer. All rights reserved.
//
import RxSwift
import RxCocoa
View Top Gear Specials.txt
+--------+---------+-------------------------+
| Series | Episode | Description |
+--------+---------+-------------------------+
| 7 | 7 | Winter Olympics |
| 0 | 12 | Polar Challenge |
| 9 | 3 | Southeast America |
| 10 | 4 | Botswana |
| 12 | 8 | Vietnam |
| 14 | 6 | Bolivia |
| 0 | 33 | Northeast America |
@cliss
cliss / RxUIWebViewDelegateProxy.swift
Created Mar 29, 2016
Reactive Extensions for UIWebView
View RxUIWebViewDelegateProxy.swift
//
// RxUIWebViewDelegateProxy.swift
//
// Created by Casey Liss on 24/3/16.
// Copyright © 2016 Casey Liss. All rights reserved.
//
import Foundation
import RxSwift
import RxCocoa
@cliss
cliss / Playground.swift
Created Mar 16, 2016
Doing bad things with delegation
View Playground.swift
import UIKit
import CoreLocation
import XCPlayground
XCPlayground.XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
class LocationDelegate: NSObject, CLLocationManagerDelegate {
override var description: String {
get {
return "LocationDelegate"
View DebugTimer.cs
public class DebugTimer : IDisposable
{
private readonly System.Diagnostics.Stopwatch _watch;
private readonly string _blockName;
/// <summary>
/// Creates a timer.
/// </summary>
/// <param name="blockName">Name of the block that's being timed</param>
public DebugTimer(string blockName)
@cliss
cliss / gist:c618e3e20f9539f69568
Created Jul 1, 2014
Accidental Bot Death Again
View gist:c618e3e20f9539f69568
2014-07-01T02:42:51.132915+00:00 app[web.1]: /app/node_modules/ws/lib/WebSocket.js:187
2014-07-01T02:42:51.132453+00:00 app[web.1]:
2014-07-01T02:42:51.133218+00:00 app[web.1]: else throw new Error('not opened');
2014-07-01T02:42:51.133233+00:00 app[web.1]: ^
2014-07-01T02:42:51.135282+00:00 app[web.1]: Error: not opened
2014-07-01T02:42:51.135285+00:00 app[web.1]: at WebSocket.send (/app/node_modules/ws/lib/WebSocket.js:187:16)
2014-07-01T02:42:51.135287+00:00 app[web.1]: at /app/accidentalbot.js:17:20
2014-07-01T02:42:51.135288+00:00 app[web.1]: at Array.forEach (native)
2014-07-01T02:42:51.135290+00:00 app[web.1]: at sendToAll (/app/accidentalbot.js:16:17)
2014-07-01T02:42:51.135292+00:00 app[web.1]: at WebSocket.<anonymous> (/app/accidentalbot.js:266:21)
View gist:95771f78a664954a03b3
2014-06-26T01:10:17.378902+00:00 app[web.1]: events.js:74
2014-06-26T01:10:17.378536+00:00 app[web.1]:
2014-06-26T01:10:17.379267+00:00 app[web.1]: throw TypeError('Uncaught, unspecified "error" event.');
2014-06-26T01:10:17.379276+00:00 app[web.1]: ^
2014-06-26T01:10:17.381818+00:00 app[web.1]: TypeError: Uncaught, unspecified "error" event.
2014-06-26T01:10:17.381821+00:00 app[web.1]: at TypeError (<anonymous>)
2014-06-26T01:10:17.381823+00:00 app[web.1]: at WebSocket.emit (events.js:74:15)
2014-06-26T01:10:17.381825+00:00 app[web.1]: at Receiver.self._receiver.onerror (/app/node_modules/ws/lib/WebSocket.js:719:10)
2014-06-26T01:10:17.381827+00:00 app[web.1]: at Receiver.error (/app/node_modules/ws/lib/Receiver.js:301:8)
2014-06-26T01:10:17.381828+00:00 app[web.1]: at Receiver.processPacket (/app/node_modules/ws/lib/Receiver.js:187:10)
You can’t perform that action at this time.