Skip to content

Instantly share code, notes, and snippets.

View YuriD4's full-sized avatar

Yuri Chukhlib YuriD4

View GitHub Profile
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
https://search.umico.az/v1/marketing_names/803?country_id=1&city_id=1
{
"partner_cpa_network": null,
"name_sortable": "U.S. Polo ASSN.",
"cashback_percentage": 3.5,
"partner_social_accounts": [
{
"link": "https://www.facebook.com/webuspoloaz/",
"social_network": "facebook"
Bettingrounds:
{
"status": "success",
"data": {
"advertisement": {
"rounds": [
{
"ext_id": "0c1f4671-e108-4fef-98ee-95b54bc994a5",
"start_date": "2019-10-20T10:00:00Z",
@YuriD4
YuriD4 / env-4.swift
Last active October 2, 2017 06:26
Env
extension Bundle {
var apiBaseURL: String {
return object(forInfoDictionaryKey: "serverBaseURL") as? String ?? ""
}
}
//And call it from the code like this:
let baseURL = Bundle.main.apiBaseURL
@YuriD4
YuriD4 / env-3.swift
Created September 23, 2017 20:50
Env
#if DEVELOPMENT
let SERVER_URL = "http://dev.server.com/api/"
let API_TOKEN = "asfasdadasdass"
#else
let SERVER_URL = "http://prod.server.com/api/"
let API_TOKEN = "fgbfkbkgbmkgbm"
#endif
@YuriD4
YuriD4 / env-2.swift
Created September 23, 2017 18:51
Env
enum Environment {
case development
case staging
case production
}
let environment: Environment = .development
switch environment {
case .development:
@YuriD4
YuriD4 / env-1.swift
Created September 23, 2017 18:43
Env
// MARK: - Development
let APIEndpointURL = "http://mysite.com/dev/api"
let analyticsKey = "jsldjcldjkcs"
// MARK: - Production
// let APIEndpointURL = "http://mysite.com/prod/api"
// let analyticsKey = "sdcsdcsdcdc"
// MARK: - Staging
// let APIEndpointURL = "http://mysite.com/staging/api"
@YuriD4
YuriD4 / dragdrop-4.swift
Last active September 8, 2017 10:58
Code sample #3 from drag&drop tutorial
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) {
for dragItem in session.items { // (1)
// (2)
dragItem.itemProvider.loadObject(ofClass: UIImage.self, completionHandler: { object, error in
// (3)
guard error == nil else { return print("Failed to load our dragged item") }
guard let draggedImage = object as? UIImage else { return } // (4)
DispatchQueue.main.async { // (5)
let imageView = UIImageView(image: draggedImage) // (6)
@YuriD4
YuriD4 / dragdrop-3.swift
Last active September 5, 2017 21:37
Code sample #3 from drag&drop tutorial
class ViewController: UIViewController, UIDropInteractionDelegate {
override func viewDidLoad() {
super.viewDidLoad()
view.addInteraction(UIDropInteraction(delegate: self))
}
func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) {
}
@YuriD4
YuriD4 / dragdrop-2.swift
Last active September 4, 2017 22:52
Code sample #2 from drag&drop tutorial
view.addInteraction(UIDropInteraction(delegate: self))