Skip to content

Instantly share code, notes, and snippets.

public protocol MapInteraction {
var visibleArea: Polygon? { get set }
var visibleAreaPublisher: AnyPublisher<Polygon?, Never> { get }
}
@eito
eito / results.txt
Created April 19, 2021 09:12
Top NHL "played with or against" percentages as of 4/18/2021
J. Jagr.............3385 = 41.5%
P. Marleau..........3197 = 39%
J. Thornton.........3154 = 38.6%
Z. Chara............3109 = 38.1%
S. Doan.............2967 = 36.3%
C. Chelios..........2915 = 35.7%
J. Iginla...........2871 = 35.1%
M. Messier..........2857 = 35%
M. Recchi...........2796 = 34.2%
D. Andreychuk.......2707 = 33.1%
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 17 columns, instead of 15. in line 5.
START_DATE,START_TIME,START_TIME_ET,SUBJECT,LOCATION,DESCRIPTION,END_DATE,END_DATE_ET,END_TIME,END_TIME_ET,REMINDER_OFF,REMINDER_ON,REMINDER_DATE,REMINDER_TIME,REMINDER_TIME_ET,SHOWTIMEAS_FREE,SHOWTIMEAS_BUSY
01-14-2021,12:00 AM,3:00 AM,Anaheim at Vegas,T-Mobile Arena - Las Vegas - NV,,01-14-2021,01-14-2021,3:00 AM,6:00 AM,FALSE,TRUE,01-14-2021,11:00 PM,2:00 AM,FREE,BUSY
01-16-2021,12:00 AM,3:00 AM,Anaheim at Vegas,T-Mobile Arena - Las Vegas - NV,,01-16-2021,01-16-2021,3:00 AM,6:00 AM,FALSE,TRUE,01-16-2021,11:00 PM,2:00 AM,FREE,BUSY
01-18-2021,12:00 AM,3:00 AM,Arizona at Vegas,T-Mobile Arena - Las Vegas - NV,,01-18-2021,01-18-2021,3:00 AM,6:00 AM,FALSE,TRUE,01-18-2021,11:00 PM,2:00 AM,FREE,BUSY
01-20-2021,12:00 AM,3:00 AM,Arizona at Vegas,T-Mobile Arena - Las Vegas - NV,,01-20-2021,01-20-2021,3:00 AM,6:00 AM,FALSE,TRUE,01-20-2021,11:00 PM,2:00 AM,FREE,BUSY
01-22-2021,12:00 AM,3:00 AM,Vegas at Arizona,Gila River Arena - Glendale - AZ,,01-22-2021,01-22-2021,3:00 AM,6:00 AM,FALSE,TRUE,01-22-2021,11:00 PM,2:00 AM
import SwiftUI
struct PullToRefreshSample: View {
let items = [
"one", "two", "three", "four", "five"
]
@State private var isRefreshing = true
import UIKit
import BackgroundTasks
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// app data, just contains a lastUpdateTime property that is set whenever
// handleAppRefresh is called as a way to validate the bgFetch is being triggered
// by iOS
//
@eito
eito / init.swift
Created March 27, 2020 18:55
Initialization of Swift class
import Foundation
class Foo: CustomStringConvertible {
static func calculatedValue(for thing: String) -> String {
return thing.uppercased()
}
func calculatedValue(for thing: String) -> String {
return thing.uppercased()
@eito
eito / auth.swift
Created February 20, 2019 23:47
iOS Authentication Session for iOS 11/12
import Foundation
import SafariServices
import AuthenticationServices
private protocol AuthenticationSessionProvider {
func start() -> Bool
func cancel()
}
extension SFAuthenticationSession: AuthenticationSessionProvider {}
//
// ViewController.swift
// TweetPing_iOS
import UIKit
class TweetPingLayer: CAShapeLayer {
var pingColor: UIColor! {
@eito
eito / main.swift
Created February 25, 2015 03:56
swift conditional compile
#if DEBUG
println("Debug mode")
#else
println("Release Mode")
#endif
#if false
println("This code will never run")
#endif
@eito
eito / fp.swift
Created October 7, 2014 06:28
functional programming
// Functional Programming exercises.
//
// Rules:
// 1. No loops (for, while, do/while)!
// 2. No if, else, or switch statements.
// 3. No "var" variables - only "let".
//
// Functions to use:
// map, reduce, filter
//