Skip to content

Instantly share code, notes, and snippets.

View morajabi's full-sized avatar

Mo morajabi

View GitHub Profile
@morajabi
morajabi / FormState.swift
Last active October 16, 2024 12:28
Form state management in Swift UI
import SwiftUI
struct FormStateData {
var loading: Bool
var error: String?
var succeeded: Bool?
}
// A helper for easier state management for simple forms
class FormState: ObservableObject {
@morajabi
morajabi / bun-lint-test-typecheck.yml
Created December 7, 2024 08:26
Bun test, lint, and typecheck your Bun project in GitHub actions with caching
# .github/workflows/test.yml
on:
push:
branches:
- main
pull_request:
branches:
- main
@morajabi
morajabi / FPSCounter.swift
Created December 29, 2024 19:16
An FPS Counter for macOS apps built for inline.chat
import AppKit
import Charts
import CoreVideo
import SwiftUI
struct FPSMeasurement: Identifiable, Equatable {
let id: Int
let fps: Int
static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool {