This file contains hidden or 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
// Note: this should be converted into an extension of a new protocol, | |
// such that the return type is the actual type and not a static `UIView` | |
extension UIView { | |
static func nibInstance() -> UIView? { | |
if let view = Bundle.mainBundle.loadNibNamed(String.className(self), owner: nil, options: nil)?.first as? UIView { | |
return loginView | |
} | |
return nil | |
} |
This file contains hidden or 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
private static let digitNames = | |
[0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four", | |
5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine"] | |
extension Array { | |
func translateToDigitalNames()-> [String]? { | |
let numbers: [Int] = self.filter { $0 is Int }.map { $0 as Int } | |
if numbers.count != self.count { |
This file contains hidden or 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
var matrix = [[[0, 1], [2, 3]], [[4, 5], [5, 6]]] | |
matrix[1][1][1] | |
var r = [Int](count: 3, repeatedValue: 0) | |
var c = [[Int]](count: 3, repeatedValue: r) | |
var m = [[[Int]]](count: 3, repeatedValue: c) | |
m[0][0][0] |
This file contains hidden or 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
class SomeClass { | |
var _optionalVar: String? | |
var nonoptionalVar: String? { | |
get { return _optionalVar } | |
set { _optionalVar = newValue == nil ? "123" : newValue } | |
} | |
init() { | |
self.nonoptionalVar = nil |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am jeden on github. | |
* I am antbello (https://keybase.io/antbello) on keybase. | |
* I have a public key whose fingerprint is C2C0 BBFC 0AA8 2A32 1B82 839E 7CDB 6990 87B5 398B | |
To claim this, I am signing this object: |
This file contains hidden or 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
var fs = require('fs'); | |
function isPlayerBanned(name,isbanned) { | |
fs.readFile('bans.json', 'utf8', function (err,data) { | |
if (err) { | |
console.log(err); | |
} | |
var retorna; |