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
$wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2 | |
$tar xvf protobuf-2.5.0.tar.bz2 | |
$cd protobuf-2.5.0 | |
$./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
$make -j 4 | |
$sudo make install | |
$protoc --version |
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
// | |
// AsynchronousBlockOperation.swift | |
// | |
// Created by Jose Canepa on 12/13/17. | |
// Copyright © 2017 Jose Canepa. All rights reserved. | |
// | |
import Foundation | |
/// Block based version of the AsynchronousOperation |
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 | |
/// ShowTime displays your taps and swipes when you're presenting or demoing. | |
/// Change the options to customise ShowTime. | |
public final class ShowTime: NSObject { | |
/// Defines if and when ShowTime should be enabled. | |
/// | |
/// - always: ShowTime is always enabled. | |
/// - never: ShowTime is never enabled. |
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 UIDevice { | |
/** | |
Returns device ip address. Nil if connected via celluar. | |
*/ | |
func getIP() -> String? { | |
var address: String? |
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
// Original video tutorial | |
// https://www.youtube.com/watch?v=6iSuc2vxT8g | |
// 0. Install a Homebrew | |
// https://brew.sh/ | |
// 1. Install Ruby to your Mac | |
// brew install ruby | |
// 2. Install aria2 tool |
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 Alamofire | |
import Foundation | |
final class CustomAlamofireManager: Alamofire.SessionManager { | |
private static let requestTimeOutTimeInterval: TimeInterval = { | |
#if DEBUG | |
return 30.0 | |
#else | |
return 120.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 | |
import PlaygroundSupport | |
let page = PlaygroundPage.current | |
page.needsIndefiniteExecution = true | |
func palindrome(for string: String) -> Bool { | |
let arr = Array(string.lowercased()) | |
// NOTE: from the natural language point of view empty string - is not a palindrome |
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 UIApplication { | |
// MARK: Public | |
func isRunningInTestFlightEnvironment() -> Bool { | |
if isSimulator() { | |
return false | |
} else { | |
if isAppStoreReceiptSandbox() && !hasEmbeddedMobileProvision() { |
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
[ | |
{"locale_key": "bs", "Marathi": "Bosnian", | |
"capital": { | |
"name": "New Delhi", | |
"latitude": 28.6357600, | |
"longitude": 77.2244500 | |
} | |
}, | |
{"locale_key": "ee_TG", "Marathi": "Ewe (Togo)", | |
"capital": { |