Skip to content

Instantly share code, notes, and snippets.

@laurenzlong
laurenzlong / index.js
Last active October 4, 2021 04:55
Firebase Cloud Messaging + Cloud Functions
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.sendLeaderboardMesssage = functions
.database
.ref('/leaderboard/{position}')
.onUpdate((change) => {
const oldPlayer = change.before.val();
@kobeumut
kobeumut / SimpleParsingJson.swift
Created January 5, 2018 19:01
Simple Fetch Url and Parse Json on Swift 4 with codable and URLSession
func fetchResultsFromApi() {
struct MyGitHub: Codable {
let name: String?
let location: String?
let followers: Int?
let avatarUrl: URL?
let repos: Int?
private enum CodingKeys: String, CodingKey {
@zacwest
zacwest / ios-font-sizes.swift
Last active April 24, 2025 07:18
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik