This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Switch.swift | |
// Re-Engineering UISwitch | |
// | |
// Created by Nathan Tannar on 15/12/18. | |
// Copyright © 2018 Nathan Tannar. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CGFloat { | |
func normalize(min: CGFloat, max: CGFloat, from a: CGFloat = 0, to b: CGFloat = 1) -> CGFloat { | |
return (b - a) * ((self - min) / (max - min)) + a | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UITextViewPlaceholder.swift | |
// TextViewPlaceholder | |
// | |
// Copyright (c) 2017 Tijme Gommers <tijme@finnwea.com> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBDesignable | |
public class Gradient: UIView { | |
@IBInspectable var startColor: UIColor = .black { didSet { updateColors() }} | |
@IBInspectable var endColor: UIColor = .white { didSet { updateColors() }} | |
@IBInspectable var startLocation: Double = 0.05 { didSet { updateLocations() }} | |
@IBInspectable var endLocation: Double = 0.95 { didSet { updateLocations() }} | |
@IBInspectable var horizontalMode: Bool = false { didSet { updatePoints() }} | |
@IBInspectable var diagonalMode: Bool = false { didSet { updatePoints() }} | |
override public class var layerClass: AnyClass { CAGradientLayer.self } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIButton { | |
func pulsate() { | |
let pulse = CASpringAnimation(keyPath: "transform.scale") | |
pulse.duration = 0.2 | |
pulse.fromValue = 0.95 | |
pulse.toValue = 1.0 | |
pulse.autoreverses = true | |
pulse.repeatCount = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserDefaults.standard.removeObject(forKey: "is_app_launched") | |
extension UserDefaults { | |
static func resetDefaults() { | |
if let bundleID = Bundle.main.bundleIdentifier { | |
UserDefaults.standard.removePersistentDomain(forName: bundleID) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'mysql' => array( | |
'driver' => 'mysql', | |
'host' => 'localhost', | |
'database' => 'database', | |
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', | |
'username' => 'root', | |
'password' => 'root', | |
'charset' => 'utf8', |