I hereby claim:
- I am paulofaria on github.
- I am paulofaria (https://keybase.io/paulofaria) on keybase.
- I have a public key ASA9I3mvYfKYE0nmeOeKiAd6QQFVes_Tf9g5fVLc1F2JkAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
04cf6f5f20811a3cc36f82de9517ef0f9cf5868e5ae2f26678c241a4ca6ee05b59696835857185f085ef40ea970e515828a8460d4b22d7d1f7dd1c7e9ff2724143 |
import Foundation | |
extension String : CodingKey { | |
public var stringValue: String { | |
return self | |
} | |
public var intValue: Int? { | |
return Int(self) | |
} |
import Foundation | |
struct HTTPRequest { | |
enum Method { | |
case get | |
case post | |
case put | |
case patch | |
case delete | |
protocol A { | |
static var a: String { get } | |
} | |
extension A { | |
static var a: String { | |
return "a" | |
} | |
} |
public func solution(N : Int) -> Int { | |
let bytes = String(N, radix: 2) | |
var max = 0 | |
var current = 0 | |
for n in bytes.characters { | |
if n == "0" { | |
current += 1 | |
} else { | |
if current > max { |
#!/usr/bin/swift | |
#if os(Linux) | |
@_exported import Glibc | |
#else | |
@_exported import Darwin.C | |
#endif | |
public struct Environment { | |
public subscript(variable: String) -> String? { |
func getDateTime() -> (String, String) { | |
let now = NSDate() | |
let dayTimePeriodFormatter = NSDateFormatter() | |
dayTimePeriodFormatter.dateFormat = "E, d MMM yyyy" | |
let date = dayTimePeriodFormatter.string(from: now) | |
dayTimePeriodFormatter.dateFormat = "HH:mm:ss Z" | |
let time = dayTimePeriodFormatter.string(from: now) |