Skip to content

Instantly share code, notes, and snippets.

@Alhomaidhi
Alhomaidhi / ClearCacheGist.txt
Created February 24, 2023 23:42
Remove cached file from repo
## Use when updating '.gitignore' and wanting the changes to reflect on the repo
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@Alhomaidhi
Alhomaidhi / NetworkingRectangularButton.swift
Created September 5, 2021 14:11
A SwiftUI button that reacts to networking requests.
struct NetworkingRectangularButton: View {
@State var buttonText: String
@State var backgroundColor: Color
@Binding var buttonState: ButtonState
let cornerRadius: CGFloat = 6
let circleCornerRaduis: CGFloat = UIScreen.main.bounds.width / 2
let width: CGFloat = UIScreen.main.bounds.width / 1.2
let height: CGFloat = 48
@Alhomaidhi
Alhomaidhi / MDTextField.swift
Last active February 1, 2023 16:07
Material Design textField to SwiftUI (SwiftUI Use)
//
// MDTextField.swift
// ValidationDemo
//
// Created by Abdullah Alhomaidhi on 15/06/2021.
//
import SwiftUI
struct MDTextField: View {
@Alhomaidhi
Alhomaidhi / UIMDTextField.swift
Last active November 12, 2023 15:52
Material Design textField to SwiftUI (UIViewRepresentable)
//
// MDPlayground.swift
// ValidationDemo
//
// Created by Abdullah Alhomaidhi on 15/06/2021.
//
import SwiftUI
import MaterialComponents