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
| GCD http://swiftable.io/2016/06/dispatch-queues-swift-3/ | |
| PullToRefresh https://grokswift.com/pull-to-refresh-swift-table-view/ | |
| ColorScheme https://color.adobe.com/create/color-wheel/ | |
| CocoaRandomRead https://littlebitesofcocoa.com/random?cb=1478241403 |
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
| //http://stackoverflow.com/a/29617215/5552518 | |
| let circlePath = UIBezierPath(arcCenter: CGPoint(x: 100,y: 100), radius: CGFloat(20), startAngle: CGFloat(0), endAngle:CGFloat(M_PI * 2), clockwise: true) | |
| let shapeLayer = CAShapeLayer() | |
| shapeLayer.path = circlePath.cgPath | |
| //change the fill color | |
| shapeLayer.fillColor = UIColor.clear.cgColor |
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
| // https://inteist.com/git-remove-pods-folder-from-pushed-repository-how-to/ | |
| git filter-branch --index-filter 'git rm --cached --ignore-unmatch Pods/*' --tag-name-filter cat -- --all | |
| git push --force |
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 SystemConfiguration | |
| public class Reachability { | |
| class func isConnectedToNetwork() -> Bool { | |
| var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0)) | |
| zeroAddress.sin_len = UInt8(sizeofValue(zeroAddress)) | |
| zeroAddress.sin_family = sa_family_t(AF_INET) |
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
| // http://stackoverflow.com/a/41176030/5552518 | |
| // | |
| // ConnectionHandler.swift | |
| // iDIP | |
| // | |
| // Created by Mac on 1/17/17. | |
| // Copyright © 2017 Fatahillah. All rights reserved. | |
| // |
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 String { | |
| func localizedWith(comment:String) -> String { | |
| return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: comment) | |
| } | |
| } |
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
| echo | openssl s_client -connect <your-server-here>:443 2>/dev/null | openssl x509 -noout -dates |
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
| https://hackernoon.com/the-practical-guide-for-building-rest-api-in-nodejs-and-mongodb-include-passport-and-jwt-476720b70da0 | |
| const devConfig = {}; | |
| const testConfig = {}; | |
| const prodConfig = {}; | |
| const defaultConfig = { | |
| PORT: process.env.PORT || 3000, | |
| }; | |
| function envConfig(env) { | |
| switch (env) { |
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
| # generate private key | |
| openssl genrsa -out private.pem 2048 | |
| # extatract public key from it | |
| openssl rsa -in private.pem -pubout > public.pem |