Skip to content

Instantly share code, notes, and snippets.

Sean Li seanli1

  • 86 Houses, LLC
  • New York, NY
View GitHub Profile
@seanli1
seanli1 / AppDelegate.swift
Last active May 23, 2019
AppDelegate.swift starter code with Firebase initialization that minimizes print statements and sets up remote notifications with perks: notify when app is in foreground, and clear badge on open.
View AppDelegate.swift
//
// AppDelegate.swift
//
//
// Created by Sean Li on 5/22/19.
// Copyright © 2019 Sean Li. All rights reserved.
//
import UIKit
import Firebase
@seanli1
seanli1 / FirebaseHelper.swift
Last active May 23, 2019
Add json file to your Project Navigator, and run this to upload it to Firebase easily using a demo app. Call `FirebaseHelper.uploadJsonFileToFirebase()`.
View FirebaseHelper.swift
//
// FirebaseHelper.swift
//
//
// Created by Sean Li on 5/22/19.
// Copyright © 2019 Sean Li. All rights reserved.
//
import Foundation
import Firebase
@seanli1
seanli1 / Changelog.gs
Last active May 25, 2019
Changelog script for Google Sheets (see warning)
View Changelog.gs
// WARNING: This will cause issues with the Undo function.
function onEdit(e) {
// Set sheet name (it must already exist):
var sheetName = "Changelog"
// e contains:
// - authorized mode
// - range
// - source
// - user
@seanli1
seanli1 / JSONImporterExporter.gs
Last active May 25, 2020
Import/Export JSON in Google Sheets
View JSONImporterExporter.gs
// IMPORT
/**
* Imports JSON data to your spreadsheet Ex: IMPORTJSON("http://myapisite.com","city/population")
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
*/
function IMPORTJSON(url,xpath){
@seanli1
seanli1 / DoublePicker.swift
Last active May 10, 2020
Clean DoublePicker I made since SwiftUI only offers a single Picker.
View DoublePicker.swift
import SwiftUI
struct DoublePicker: UIViewRepresentable {
let leftOptions: [Any]
@Binding var leftSelection: Int
let rightOptions: [Any]
@Binding var rightSelection: Int
You can’t perform that action at this time.