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
protocol True {} | |
struct IsBidirectional<C> {} | |
extension IsBidirectional: True where C : BidirectionalCollection { } | |
extension Collection { | |
var isBidirectional: Bool { | |
return IsBidirectional<Self>() is True | |
} | |
} | |
func testIsBidirectional() { |
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
/// - returns: `true` when dynamic type is `Equatable` and `==` returns `true`, otherwise `false`. | |
func areEquatablyEqual(_ lhs: Any, _ rhs: Any) -> Bool { | |
func receiveLHS<LHS>(_ typedLHS: LHS) -> Bool { | |
guard | |
let rhsAsLHS = rhs as? LHS | |
else { return false } | |
return areEquatablyEqual(typedLHS, rhsAsLHS) | |
} | |
return _openExistential(lhs, do: receiveLHS) | |
} |
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
// How to: | |
// 1. Open the Firebase Analytics Dashboard | |
// 2. Scroll to bottom, where you see the "Users by Device model" widget | |
// 3. Click "View device models" in that widget (this opens the "Tech details" Firebase Analytics page) | |
// 4. Above the table shown in the new page, click on the “Device model” drop down menu and select “OS with Version” | |
// 5. Make sure to select “OS with version” and not “OS Version” | |
// 6. On the top right corner of the page, click on the “Share this report” icon (next to the date) | |
// 7. Click “Download file” on the new side bar, then “Download CSV" | |
// 8. Open the file and select the iOS/Android breakdown raw data | |
// 9. Replace the sample data in this script with your data |
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
// | |
// Moon.h | |
// Blackbox | |
// | |
// Created by Ryan McLeod on 12/2/14. | |
// Copyright (c) 2014 Ryan McLeod. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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
Banco do Brasil = "bbapp://" | |
Bradesco = "BDNiPhoneVarejo://" | |
Bradesco Prime = "BDNiPhonePrime://" | |
Itaú = "itauvarejo://" | |
Itaú Personnalité = "itaupersonnalite://" | |
Santander = "santanderpf://" | |
Sicoob = "sicoob://" | |
Neon = "banconeon://" | |
Nubank = "nuapp://" |
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
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
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
extension UIApplication { | |
class func appVersion() -> String { | |
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String | |
} | |
class func appBuild() -> String { | |
return Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as! 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
\lstdefinelanguage{swift} | |
{ | |
morekeywords={ | |
func,if,then,else,for,in,while,do,switch,case,default,where,break,continue,fallthrough,return, | |
typealias,struct,class,enum,protocol,var,func,let,get,set,willSet,didSet,inout,init,deinit,extension, | |
subscript,prefix,operator,infix,postfix,precedence,associativity,left,right,none,convenience,dynamic, | |
final,lazy,mutating,nonmutating,optional,override,required,static,unowned,safe,weak,internal, | |
private,public,is,as,self,unsafe,dynamicType,true,false,nil,Type,Protocol, | |
}, | |
morecomment=[l]{//}, % l is for line comment |
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
/* | |
`arc4random_uniform` is very useful but limited to `UInt32`. | |
This defines a generic version of `arc4random` for any type | |
expressible by an integer literal, and extends some numeric | |
types with a `random` method that mitigates for modulo bias | |
in the same manner as `arc4random`. | |
`lower` is inclusive and `upper` is exclusive, thus: | |
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
*.strings utf16 diff=localizablestrings |
NewerOlder