Skip to content

Instantly share code, notes, and snippets.

@mbuchetics
mbuchetics / json.swift
Created June 30, 2017 09:28 — forked from reckenrode/json.swift
Decoding arbitrary JSON with the new Decoder in Swift 4
enum JSON: Decodable {
case bool(Bool)
case double(Double)
case string(String)
indirect case array([JSON])
indirect case dictionary([String: JSON])
init(from decoder: Decoder) throws {
if let container = try? decoder.container(keyedBy: JSONCodingKeys.self) {
self = JSON(from: container)
@dlo
dlo / README.md
Last active February 2, 2024 02:18
Xcode script that automatically uploads builds to iTunes Connect after archive

Summary

This script will automatically upload your app to iTunes Connect after a successful Xcode archive action.

After doing this about a million times by hand (i.e., opening the Organizer, clicking on "Upload to App Store", waiting for teams to load, etc.), I decided I'd had enough. Now, I just go to "Product" > "Archive", sip my margherita, and kick up my feet while the world marvels at my genius, while my app gets distributed to my testers without lifting but a finger. Or...I just take a bathroom break. Either way, it's pretty awesome.

Yes, yes, I know you can do this completely via fastlane, but I'm somewhat sadistic and prefer to do my archiving completely within Xcode.

Instructions

@rmehner
rmehner / delete-databases.js
Last active July 9, 2024 10:35
Delete all indexedDB databases
// Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034
// for modern browsers, this works:
const dbs = await window.indexedDB.databases()
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) })
// for older browsers, have a look at previous revisions of this gist.