This file contains 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 | |
$sourceURL = $_GET['to']; | |
function startsWith($string, $startString) { | |
$len = strlen($startString); | |
return (substr($string, 0, $len) === $startString); | |
} | |
$html = file_get_contents($sourceURL); | |
if ($html === false) { |
This file contains 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
public extension UIFont { | |
static func loadGothamNarrow(ofSize size: CGFloat, weight: UIFont.Weight) -> UIFont { | |
let name: String = { | |
switch weight { | |
case .bold, .black, .heavy, .semibold: | |
return "GothamNarrow-Bold" | |
default: | |
return "GothamNarrow-Book" | |
} |
This file contains 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
import Foundation | |
@propertyWrapper | |
struct Published<Value> { | |
var projectedValue: Published { self } | |
var wrappedValue: Value { didSet { valueDidChange() } } | |
private var observations = MutableReference( | |
value: List<(Value) -> Void>() | |
) |
This file contains 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 UIColor { | |
// First extend UIColor to make it easier to get components out | |
var coreImageColor: CIColor { | |
return CIColor(color: self) | |
} | |
var components: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) { | |
let color = coreImageColor | |
return (color.red, color.green, color.blue, color.alpha) | |
} |