Skip to content

Instantly share code, notes, and snippets.

View mkaulfers's full-sized avatar
📱
New Motivation, New App, Can I finish this one?

Matthew Kaulfers mkaulfers

📱
New Motivation, New App, Can I finish this one?
  • Mississippi, United States
View GitHub Profile
@mkaulfers
mkaulfers / gist:7973d92aa060a9200b721915a98338dc
Created February 29, 2024 19:16
SwiftUI Asymmetrical Indefinite Progress Indicator
//
// IndefiniteProgressIndicator.swift
//
// Created by Matthew Kaulfers on 2/29/24.
//
import SwiftUI
struct IndefiniteProgressIndicator: View {
@State private var rotate1 = false
@mkaulfers
mkaulfers / gist:8cd727480d31aa7e6603feeff316c33f
Created November 12, 2023 18:57
Mastering Matched Geometry Effect in SwiftUI | List to Full-Screen Animation Tutorial
import SwiftUI
struct ContentView: View {
@Namespace var animation
@Namespace var backgroundID
@State var showingFullScreen = false
var body: some View {
TabView {
@mkaulfers
mkaulfers / Download_Iconoir.sh
Created April 14, 2023 14:58
[Broken] A script to download and add Iconoir SVG's into an `Assets.xcassets` folder in an XCode Project. Add this script to your root project directory.
#!/opt/homebrew/bin/python3
# Function to check if a command exists
command_exists() {
command -v "$1" &> /dev/null
}
# Variables
GITHUB_REPO="https://github.com/iconoir-icons/iconoir/tree/main/icons"
ASSETS_DIR="Sources/Iconoir/Assets.xcassets"
@mkaulfers
mkaulfers / Flood Fill - Buildable Area Search - Sizeable - Screeps
Created May 6, 2022 02:40
This code is a small code-snippet that will allow you to pass in a center position, and a size, as well as a room object to get back the nearest position where your search will fit, excluding any terrain. and structures. Useful for dynamic bases. It also has an iterator that can be adjusted to your liking, however it should be noted the more of …
private static validPos(x: number, y: number, size: number, room: Room): boolean {
if (x < 0 || y < 0) return false
if (x >= 50 || y >= 50) return false
if (x - Math.floor(size / 2) < 0 || y - Math.floor(size / 2) < 0) return false
if (x + Math.floor(size / 2) >= 50 || y + Math.floor(size / 2) >= 50) return false
let results = room.lookAtArea(
y - Math.floor(size / 2),
x - Math.floor(size / 2),
y + Math.floor(size / 2),