Skip to content

Instantly share code, notes, and snippets.

View juliantejera's full-sized avatar

Julian Tejera-Frias juliantejera

View GitHub Profile
@Iron-Ham
Iron-Ham / Wrappers.swift
Last active March 22, 2023 14:30
Use property wrappers to ignore a variable for synthesized `Equatable` and `Hashable`.
import Foundation
@propertyWrapper
struct IgnoreEquatable<Wrapped>: Equatable {
var wrappedValue: Wrapped
static func == (lhs: IgnoreEquatable<Wrapped>, rhs: IgnoreEquatable<Wrapped>) -> Bool {
true
}
}
@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active March 29, 2024 02:29
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@mattt
mattt / NSDecimalNumber.swift
Last active April 1, 2023 00:06
NSDecimalNumber Additions for Swift
import Foundation
// MARK: - Comparable
extension NSDecimalNumber: Comparable {}
public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool {
return lhs.compare(rhs) == .OrderedSame
}