Skip to content

Instantly share code, notes, and snippets.

View MatrixSenpai's full-sized avatar
:electron:
Hm

MatrixSenpai

:electron:
Hm
  • Matrix Studios
  • Houston, TX
View GitHub Profile
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
@MatrixSenpai
MatrixSenpai / Data Structure.md
Created August 12, 2019 17:29
Data Structure

General Structure

  • Region
    • Team
      • Player (not implemented)
    • League
      • Season
        • Winner
        • Split
          • Winner
          • Tournament
@MatrixSenpai
MatrixSenpai / twitter snowflake.swift
Created July 10, 2019 06:25
Twitter Snowflake implementation in Swift
import Foundation
public typealias Snowflake = Int64
extension Snowflake {
public static var offset: Date? = nil
private static var increment: Int = 0
public static func generate(offset: Date? = nil, workerID: Int = 0, processID: Int = 0, increment: Int = 0) -> Snowflake {
var timestamp: Double
protocol BaseTableType where Self: UITableView {
associatedtype CellType: Configurable
associatedtype ItemType: Decodable
}
class BaseTable<T: Configurable>: UITableView, BaseTableType, UITableViewDelegate {
typealias CellType = T
typealias ItemType = T.ItemType
private let bag = DisposeBag()
enum HTTPMethod: String {
case get, put, post, patch, delete
}
public protocol APIRequest {
associatedtype Response: Decodable
var base : String { get }
var endpoint: String { get }
var method : HTTPMethod { get }
}

Keybase proof

I hereby claim:

  • I am matrixsenpai on github.
  • I am matrixsenpai (https://keybase.io/matrixsenpai) on keybase.
  • I have a public key whose fingerprint is DEA5 CF7A CF55 5B78 517F 6DC9 E2EB 4CE8 8DE3 7287

To claim this, I am signing this object:

@MatrixSenpai
MatrixSenpai / eurekaWorkaround.swift
Created January 4, 2017 03:58
Eureka Form Add Row Workaround
// Your form
Section("My Form") { $0.tag = "AddSection" }
<<< TextRow("rowOne")
<<< TextRow("rowTwo")
<<< ButtonRow("addRow") {
$0.title = "Add Row"
}.onCellSelection { (cell, row) in
self.form.sectionBy(tag: "AddSection")
<<< TextRow("newRowTag")
}