FROM ibmcom/swift-ubuntu:latest
# Install Vapor Toolbox
RUN curl -sL toolbox.vapor.sh | bash
# Set work dir to /vapor
WORKDIR /vapor
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
// | |
// StringResource+Localization.swift | |
// Core | |
// | |
// Created by Johnny Gu on 2020/6/22. | |
// | |
import Foundation | |
import Rswift |
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
// | |
// ViewController.swift | |
// demo | |
// | |
// Created by Johnny Gu on 05/12/2016. | |
// Copyright © 2016 Johnny Gu. All rights reserved. | |
// | |
import UIKit |
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
struct YourUserDefaults { | |
... | |
func set(_ value: Any?, for key: String) { | |
// some encrypt work | |
... | |
UserDefaults.standard.set(ValueAfterEncrypt, forKey: key) | |
} | |
func object(for key: String) -> Any?{ | |
let value = UserDefaults.standard.value(forKey: key) |
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
struct YourUserDefaults { | |
... | |
func set(_ value: Any?, for key: String) { | |
// some encrypt work | |
... | |
UserDefaults.standard.set(ValueAfterEncrypt, forKey: key) | |
} | |
func object(for key: String) -> Any?{ | |
let value = UserDefaults.standard.value(forKey: key) |
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
// | |
// MLLabel.swift | |
// Starbucks | |
// | |
// Created by Johnny Gu on 09/01/2017. | |
// Copyright © 2017 Wiredcraft. All rights reserved. | |
// | |
import UIKit |
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
// coming form https://gist.github.com/onevcat/2d1ceff1c657591eebde, adapt swift3 | |
private class Block<T> { | |
let f : T | |
init (_ f: T) { self.f = f } | |
} | |
extension Timer { | |
static func xxx_scheduledTimer(timeInterval ti: TimeInterval, repeats: Bool, block: ()->()) -> Timer { | |
return self.scheduledTimer(timeInterval: ti, target: self, selector: #selector(xxx_blcokInvoke), userInfo: Block(block), repeats: repeats) | |
} |
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
<style> | |
body { | |
} | |
#container { | |
background-color: rgb(238,238,238); | |
margin: 60px 20px 20px 20px; | |
border-radius: 10px; | |
} | |
#imgContainer{ |