Skip to content

Instantly share code, notes, and snippets.

View mflknr's full-sized avatar
🌿
Eat RAM not animals

Marius Felkner mflknr

🌿
Eat RAM not animals
View GitHub Profile
//
// ContentView.swift
// MadeForYouCard
//
// Created by AppleDesignDev on 1/24/22.
//
import SwiftUI
struct ContentView: View {
//
// SemanticVersioning.swift
//
//
// Created by Richard Stelling on 28/05/2020.
//
// The MIT License (MIT)
//
// Copyright (c) 2016-17 Richard Stelling (http://twitter.com/rjstelling)
@rjstelling
rjstelling / RegularExpressionValidation.swift
Created March 23, 2020 10:09
A `@propertyWrapper` that validates a string using a regular expression. If the string matches then it is assigned to the property if it does not then the property is net to nil. Also included is an example of validating email addresses.
import Foundation
@propertyWrapper
public struct RegularExpressionValidation {
private var _verifiedString: String?
private let _regexPattern: String
private lazy var _regex: NSRegularExpression? = try? NSRegularExpression(pattern: _regexPattern, options: [.caseInsensitive])
public init(_ regexString: String) {
@AvdLee
AvdLee / FileManagerExtensions.swift
Last active November 19, 2023 23:23
Easily print out useful locations for usage during debugging on the Simulator.
extension FileManager {
/*
Prints out the locations of the simulator and the shared group folder.
This is useful for debugging file issues.
Example usage: FileManager.default.printFileLocations()
*/
func printFileLocations() {
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let simulatorFolder = paths.last!
@parmentf
parmentf / ConventionalCommitsEmoji.md
Last active May 20, 2024 03:18
Emoji for Conventional Commits
Type Emoji code
feat :sparkles:
fix 🐛 :bug:
docs 📚 :books:
style 💎 :gem:
refactor 🔨 :hammer:
perf 🚀 :rocket:
test 🚨 :rotating_light:
build 📦 :package:
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)