Skip to content

Instantly share code, notes, and snippets.

Avatar

Jurvis Tan jurvis

View GitHub Profile
@jurvis
jurvis / DocDirectoryBacked.swift
Created Aug 15, 2020
Swift Property Wrapper for Saving Values to JSON in Documents Directory
View DocDirectoryBacked.swift
@propertyWrapper struct DocDirectoryBacked<Value: Codable> {
let location: String
let documentDirectory = try! FileManager.default.url(for: .libraryDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
private var dirToSave: URL {
return documentDirectory.appendingPathComponent("\(location).json")
}
var wrappedValue: Value? {
get {
@jurvis
jurvis / README.md
Last active Oct 13, 2015
How We Calculate Data @ Nebulo
View README.md

Our Data

Nebulo's data all conform to US EPA AQI standards. See below for the specific description of each country.

Singapore & Hong Kong

Singapore and Hong Kong both offer 1-hour PM2.5 readings in ug/m3. We take these readings and convert them to US EPA AQI using PM2.5 as the pollutant.

Singapore Data source: National Environment Agency - Haze Updates, 1-hr PM2.5 Readings

Hong Kong Data source: Environmental Protection Department - Air Quality Health Index (AQHI), Pollutant concentrations

View gist:9895073
### Keybase proof
I hereby claim:
* I am jurvis on github.
* I am jurvis (https://keybase.io/jurvis) on keybase.
* I have a public key whose fingerprint is 4506 CE5F B766 0FB4 F883 D7A9 B4BA 1210 56E0 19C9
To claim this, I am signing this object: