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
$ npm -v | |
module.js:338 | |
throw err; | |
^ | |
Error: Cannot find module 'npmlog' | |
at Function.Module._resolveFilename (module.js:336:15) | |
at Function.Module._load (module.js:278:25) | |
at Module.require (module.js:365:17) | |
at require (module.js:384:17) | |
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:18:11 |
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
class User { | |
private struct Static { | |
static var instance: User? | |
} | |
class var sharedInstance: User { | |
if let instance = Static.instance { | |
return instance | |
} |
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
var c = "2015-02-06 19:48:31".toDate(format: "yyyy-M-d HH:mm:ss")?.stringForTimeIntervalSinceCreated() // optional | |
println(c) // Optional("5 days") |