Skip to content

Instantly share code, notes, and snippets.

View zhangqifan's full-sized avatar

Shuhari zhangqifan

View GitHub Profile
@Pash237
Pash237 / ISO8601DateFormatter.swift
Last active July 20, 2024 12:58
Fast implementation for ISO8601 date formatter. Around 30 times faster than using (cached) DateFormatter
class ISO8601DateFormatter {
private static var cachedCalendar: Calendar = {
var calendar = Calendar(identifier: .gregorian)
calendar.timeZone = TimeZone.gmt
return calendar
}()
static func format(_ date: Date) -> String {
let components = cachedCalendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
@OleMchls
OleMchls / gist:3866389
Created October 10, 2012 15:35
iTunes API result
{
"kind": "software",
"features": [
"iosUniversal",
"newsstand"
],
"supportedDevices": [
"all"
],
"isGameCenterEnabled": false,