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
# 1. Convert the .cer file into a .pem file: | |
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem | |
# 2. Convert the private key’s .p12 file into a .pem file: | |
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem | |
# 3. Finally, combine the certificate and key into a single .pem file | |
$ cat PushChatCert.pem PushChatKey.pem > ck.pem | |
# 4. At this point it’s a good idea to test whether the certificate works. |
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
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |
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
//reduce | |
//Use reduce to combine all items in a collection to create a single new value. | |
let numbers = [1, 3, 5, 7, 9] | |
//sum all values from the array (+) | |
let result = numbers.reduce(0, +) | |
//sum all values from the array (+) plus one | |
let result2 = numbers.reduce(1, +) | |
let result3 = numbers.reduce(1, *) |
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
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375"," |
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
<?php | |
/** | |
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
**/ | |
return array( | |
100 => 'Continue', | |
101 => 'Switching Protocols', | |
102 => 'Processing', // WebDAV; RFC 2518 | |
200 => 'OK', |
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 StoreKit | |
//MARK: SKProductsRequestDelegate | |
extension IAPHelpers : SKProductsRequestDelegate | |
{ | |
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) | |
{ |
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
// | |
// InAppManager.swift | |
// | |
// Created by Ellina Kuznetcova on 12/10/2016. | |
// Copyright © 2016 Flatstack. All rights reserved. | |
// | |
import Foundation | |
import StoreKit |
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
func printFonts() { | |
let fontFamilyNames = UIFont.familyNames | |
for familyName in fontFamilyNames { | |
print("------------------------------") | |
print("Font Family Name = [\(familyName)]") | |
let names = UIFont.fontNames(forFamilyName: familyName) | |
print("Font Names = [\(names)]") | |
} | |
} |
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 HapticHelper { | |
enum HapticType { | |
case impactLight | |
case impactMedium | |
case impactHeavy | |
case selectionChange | |
case notificationSuccess | |
case notificationError |
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 | |
import UIKit | |
enum TextType: CaseIterable { | |
case title | |
case subtitle | |
case sectionTitle | |
case body | |
case comment |
OlderNewer