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
| import UIKit | |
| open class PaddedTextField: UITextField { | |
| public var textInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) { | |
| didSet { setNeedsDisplay() } | |
| } | |
| public override init(frame: CGRect) { | |
| super.init(frame: frame) | |
| } |
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
| final class ApplicationContext { | |
| // This is where you initialize most of the application stack | |
| // that needs to be passed down to the coordinator chain for | |
| // fetching data, and other important stuff. | |
| // Example: | |
| // let networkClient = NetworkClient() | |
| } |
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
| import UIKit | |
| import Forbind | |
| import ForbindExtensions | |
| import Haneke | |
| typealias ImageProcess = (UIImage) -> UIImage | |
| public class ImageCache { | |
| public static let shared = ImageCache() |
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
| root@speakerdex:~# dokku --trace redis:backup speakerdex-sessions speakerdex-redis-backups | |
| + export DOKKU_DISTRO | |
| ++ . /etc/os-release | |
| ++ echo ubuntu | |
| + DOKKU_DISTRO=ubuntu | |
| + export DOKKU_IMAGE=gliderlabs/herokuish | |
| + DOKKU_IMAGE=gliderlabs/herokuish | |
| + export DOKKU_LIB_ROOT=/var/lib/dokku | |
| + DOKKU_LIB_ROOT=/var/lib/dokku | |
| + export PLUGIN_PATH=/var/lib/dokku/plugins |
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
| + export DOKKU_DISTRO | |
| ++ . /etc/os-release | |
| ++ echo ubuntu | |
| + DOKKU_DISTRO=ubuntu | |
| + export DOKKU_IMAGE=gliderlabs/herokuish | |
| + DOKKU_IMAGE=gliderlabs/herokuish | |
| + export DOKKU_LIB_ROOT=/var/lib/dokku | |
| + DOKKU_LIB_ROOT=/var/lib/dokku | |
| + export PLUGIN_PATH=/var/lib/dokku/plugins | |
| + PLUGIN_PATH=/var/lib/dokku/plugins |
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
| import Foundation | |
| import Vapor | |
| import FluentProvider | |
| struct Paginator<T: Model> where T: JSONRepresentable { | |
| let query: Query<T> | |
| let request: Request | |
| let perPage: Int | |
| init(query: Query<T>, request: Request, perPage: Int = 25) { |
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
| apt-get update | |
| apt-get install -y build-essential curl | |
| apt-get -y install git g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools | |
| git clone https://github.com/tatsuhiro-t/nghttp2.git | |
| cd nghttp2 | |
| autoreconf -i | |
| automake | |
| autoconf | |
| ./configure | |
| make |
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
| import Foundation | |
| import UIKit | |
| extension UIView { | |
| func addSubviews(_ subviews: [UIView]) { | |
| for view in subviews { | |
| addSubview(view) | |
| } | |
| } | |
| } |
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 URI { | |
| public func appendingQueryParameters(_ parameters: [String: String]) -> URI { | |
| let allParameters = mergeParameters(queryParameters(fromQuery: query), rhs: parameters) | |
| let newQuery = toQuery(parameters: allParameters) | |
| return URI(scheme: scheme, userInfo: userInfo, hostname: hostname, port: port, path: path, | |
| query: newQuery, fragment: fragment) | |
| } | |
| private func toQuery(parameters: [String: String]) -> String { |
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
| import React, { Component } from 'react'; | |
| const hasDataForThisKey = (staticContext) => | |
| (key) => staticContext && Object.keys(staticContext.data).includes(key); | |
| const windowHasDataForThisKey = (window) => | |
| (key) => Object.keys(window.__DATA__).includes(key); | |
| export default ({ | |
| key, |