This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Once you've signed in with Apple in your iOS app, turn the `identityToken` into a string with something like | |
`String(data: identityToken, encoding: .utf8)`. Then use that string in the Authorization header: | |
`urlRequest.addValue("Bearer \(identityString)", forHTTPHeaderField: "Authorization")` | |
*/ | |
import Vapor | |
import JWT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// Rendering | |
// | |
// Created by Kyle Bashour on 11/11/19. | |
// Copyright © 2019 Kyle Bashour. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ScrollTriggeredControl: UIControl { | |
private let dragThreshold: CGFloat = 80 | |
private var previousFraction: CGFloat = 0 | |
private var shouldTrigger = false | |
private var offsetObservation: NSKeyValueObservation? | |
private let imageView = UIImageView() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ScrollTriggeredControl: UIControl { | |
private let dragThreshold: CGFloat = 80 | |
private var previousFraction: CGFloat = 0 | |
private var shouldTrigger = false | |
private var offsetObservation: NSKeyValueObservation? | |
private let imageView = UIImageView() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Decoding a `Bar` gives you the same UUID that it was encoded with | |
struct Bar: Codable { | |
let id: UUID | |
init() { | |
self.id = UUID() | |
} | |
} | |
// Decoding a `Foo` gives you a new UUID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController, UIScrollViewDelegate { | |
private let blueView = UIView() | |
private let redView = UIView() | |
private let scrollView = UIScrollView() | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PopoverTableViewController: UITableViewController { | |
override func viewDidLayoutSubviews() { | |
super.viewDidLayoutSubviews() | |
self.preferredContentSize = CGSize(width: 320, height: self.tableView.contentSize.height) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
class Foo<T> { | |
init(first: T, second: Int = 10) {} | |
} | |
class Bar: Foo<Int> { | |
static func makeBar() -> Bar { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
import subprocess | |
NON_UTK_TICKET = 'Student Registration for non-UTK Students' | |
UTK_TICKET = 'Student Registration for UTK Students' | |
MENTOR_TICKET = 'Mentor Registration' | |
ORGANIZER_TICKET = 'Organizer' | |
PERCENT_NON_UTK = 0.45 |