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 | |
protocol OperationType { | |
var operationType: RequestOperationType { get } | |
} | |
public enum RequestOperationType: Int { | |
case blah | |
case devices | |
} |
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
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import os | |
import h5py | |
import numpy as np | |
### Requirement: name, path, embedding | |
''' |
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
"${PODS_ROOT}/Fabric/run" | |
# ${CONFIGURATION} usualy Debug and Release. | |
# You should create referenced folders for each Configuration (Debug and Release folders inside Firebase folder) | |
# and store GoogleService-Info.plist file | |
cp "${PROJECT_DIR}/MyApp/Resources/Firebase/${CONFIGURATION}/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
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
###### RENEW SERVER: #################################### | |
#stop nginx | |
sudo systemctl stop nginx | |
#renew | |
/opt/letsencrypt/certbot-auto renew | |
#start nginx | |
sudo systemctl start nginx | |
########################################################## |
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
## Refer to http://caffe.berkeleyvision.org/installation.html | |
# Contributions simplifying and improving our build system are welcome! | |
# cuDNN acceleration switch (uncomment to build with cuDNN). | |
# USE_CUDNN := 1 | |
# CPU-only switch (uncomment to build without GPU support). | |
CPU_ONLY := 1 | |
# uncomment to disable IO dependencies and corresponding data layers |
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
#!/bin/bash | |
# to execute it first chmod +x push.sh | |
deviceToken=<device token id from device did receive token> | |
authKey="./AuthKey_<auth_key>.p8" | |
authKeyId=<auth_key> | |
teamId=<team id> | |
bundleId=<bundle id> | |
endpoint=https://api.development.push.apple.com |
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
### GENERATING Ceritificate for XCODE: | |
### .der file ##### | |
openssl s_client -connect website.com:443 -showcerts < /dev/null | openssl x509 -outform DER > website.com.der | |
import Security | |
class NSURLSessionPinningDelegate: NSObject, URLSessionDelegate { | |
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.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
import UIKit | |
class MaterialView: UIView { | |
override func awakeFromNib() { | |
layer.cornerRadius = 2.0 | |
layer.shadowColor = UIColor(red: 157.0 / 255.0, green: 157.0 / 255.0, blue: 157.0 / 255.0, alpha: 0.5).cgColor | |
layer.shadowOpacity = 0.8 | |
layer.shadowRadius = 5.0 | |
layer.shadowOffset = CGSize(width: 0.0, height: 2.0) |
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 UIKit | |
extension UIImageView { | |
func loadImage(url: String, completed: @escaping (_ success: Bool) -> Void) { | |
API.get(url: url) { (code, object) in | |
if let img = object as? UIImage { | |
self.image = img | |
completed(true) | |
} else { | |
completed(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
import UIKit | |
//------------------------------------------------------------------------------- | |
//MARK: - API | |
class API { | |
enum Method:String { | |
case get = "GET" | |
case post = "POST" |
NewerOlder