Skip to content

Instantly share code, notes, and snippets.

View BrychanOdlum's full-sized avatar
🦄
Lorem ipsum dolor sit amet...

Brychan BrychanOdlum

🦄
Lorem ipsum dolor sit amet...
View GitHub Profile
@BrychanOdlum
BrychanOdlum / deploy.yml
Created December 5, 2019 17:47
Build and deploy React app to Github Pages via Github Actions
name: Deploy
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-latest
@jnewc
jnewc / NotesApp.swift
Last active January 21, 2024 17:40
A notes app written in >100 lines of swift using SwiftUI
import SwiftUI
let dateFormatter = DateFormatter()
struct NoteItem: Codable, Hashable, Identifiable {
let id: Int
let text: String
var date = Date()
var dateText: String {
dateFormatter.dateFormat = "MMM d yyyy, h:mm a"
@myell0w
myell0w / UIView+Hierarchy.swift
Created June 13, 2018 12:05
Traverse View Hierarchy Upwards
extension UIView {
func findFirstSuperview<T>(ofClass viewClass: T.Type, where predicate: (T) -> Bool) -> T? where T: UIView {
var view: UIView? = self
while view != nil {
if let typedView = view as? T, predicate(typedView) {
break
}
view = view?.superview
}
@CanTheAlmighty
CanTheAlmighty / DisplayLink.swift
Last active March 10, 2024 08:43
DisplayLink for OSX