Instantly share code, notes, and snippets.

Felix M. fxm90

View GitHub Profile
View 01 - Observable.swift
//
// Observable.swift
//
// Created by Felix Mau on 11/02/19.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import Foundation
class Observable<T> {
View UIView+AnimateIsHidden.swift
//
// UIView+AnimateIsHidden.swift
//
// Created by Felix Mau on 17/12/18.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import UIKit
extension UIView {
View VerticalGradientImageView.swift
//
// VerticalGradientImageView.swift
//
// Created by Felix Mau on 23/09/18.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import UIKit
class VerticalGradientImageView: UIImageView {
View String+Log.swift
//
// String+Log.swift
//
// Created by Felix Mau on 16/09/18.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import Foundation
extension String {
View CustomNotificationCenterTestCase.swift
class CustomNotificationCenterTestCase: XCTestCase {
var notificationCenter: NotificationCenter!
override func setUp() {
super.setUp()
notificationCenter = NotificationCenter()
}
View NotificationTestCase.swift
import XCTest
class NotificationTestCase: XCTestCase {
func testTriggerNotification() {
expectation(forNotification: .fooBar,
object: nil,
handler: nil)
let notificationCenter = NotificationCenter.default
View WebViewExampleViewController.swift
//
// WebViewExampleViewController.swift
//
// Created by Felix Mau on 06.01.18.
// Copyright © 2018 Felix Mau. All rights reserved.
//
import UIKit
import WebKit
View swiftlint.sh
if [ -f "${PODS_ROOT}/SwiftLint/swiftlint" ]; then
${PODS_ROOT}/SwiftLint/swiftlint
else
echo "warning: SwiftLint not installed!"
fi
View NotificationCenter+ObserveOnce.swift
extension NotificationCenter {
/// Adds an observer to the given notification center, which fires just once.
///
/// Note:
/// - Same parameters as "addObserver", but with default properties
/// See http://apple.co/2zZIYJB for details.
///
/// Parameters:
/// - name: The name of the notification for which to register the observer
View isNumeric.php
// Checks whether all given parameters are numeric.
// Usage: $validCoordinates = isNumeric($_GET['p1Lat'], $_GET['p1Lon']));
function isNumeric() {
$numberOfArguments = func_num_args();
$arguments = func_get_args();
return count(array_filter($arguments, 'is_numeric')) === $numberOfArguments;
}