Skip to content

Instantly share code, notes, and snippets.

View meteochu's full-sized avatar
💭
Probably napping.

Andy meteochu

💭
Probably napping.
View GitHub Profile
import Foundation
extension String {
var isValidEmail: Bool {
let emailRegEx = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"
return NSPredicate(format:"SELF MATCHES %@", emailRegEx).evaluate(with: self)
}
}
@meteochu
meteochu / UIImage.Effects.swift
Last active February 15, 2019 13:37
Apple's UIImageEffect in Swift using iOS 10's new UIGraphicsImageRenderer
//
// UIImage.Effects.swift
//
//
// Created by Andy Liang on 2016-06-19.
//
//
import UIKit
import Accelerate
@meteochu
meteochu / UIFont++.swift
Last active February 7, 2017 19:55
UIFont extension for UIFontTextStyle and UIFontWeight
import UIKit
extension UIFont {
enum TextStyle: String {
case title1
case title2
case title3
case headline
@meteochu
meteochu / Reachability.swift
Created March 6, 2016 08:10
Quick way to determine current Network Connection Type (Offline, WiFi, or Cellular)
//
// Reachability.swift
//
//
// Created by Andy Liang on 2016-03-06.
// Copyright © 2015 Andy Liang. All rights reserved.
//
import SystemConfiguration

Keybase proof

I hereby claim:

  • I am meteochu on github.
  • I am meteochu (https://keybase.io/meteochu) on keybase.
  • I have a public key whose fingerprint is C44A 8429 8717 AC71 E2D6 C352 425E 1B03 37AF 0745

To claim this, I am signing this object: