Skip to content

Instantly share code, notes, and snippets.

View insaineyesay's full-sized avatar
💭
print(responseMessages[403])

Michael Agee insaineyesay

💭
print(responseMessages[403])
View GitHub Profile
@insaineyesay
insaineyesay / HashTable.swift
Created November 15, 2020 06:06 — forked from davidinga/HashTable.swift
Simple Hash Table implementation in Swift. Includes Linked List, and Node structures. Basic methods.
struct HashTable<Key: Hashable, Value> {
private typealias Element = (key: Key, value: Value)
private typealias List = LinkedList<Element>
private var table: [List]
init(size: Int) {
table = Array<List>()
for _ in 0..<size {
@insaineyesay
insaineyesay / UIView+addDashedBorders.swift
Last active August 11, 2021 18:59
UIView Extension to add a border programmatically to any UIView
extension UIView {
func addDashedBorder() {
let color = UIColor.black.cgColor
let shapeLayer:CAShapeLayer = CAShapeLayer()
let frameSize = self.frame.size
let shapeRect = CGRect(x: 0, y: 0, width: frameSize.width, height: frameSize.height)
shapeLayer.bounds = shapeRect
shapeLayer.position = CGPoint(x: frameSize.width/2, y: frameSize.height/2)