Skip to content

Instantly share code, notes, and snippets.

import Foundation
// 3456789012345678901234567890123456789012345678901234567890123456789012345678
/*
Monoid reduction, for strictly binary operation combination.
Note: The monoid approach does not throw right now.
@erica
erica / fold.md
Last active August 6, 2019 19:49
import AppKit
struct AttributableString {
let attributedString: NSAttributedString
}
extension AttributableString: ExpressibleByStringLiteral {
init(stringLiteral: String) {
self.attributedString = NSAttributedString(string: stringLiteral)
}
// More String Interpolation
public extension String {
/// The direction from which a string floats when
/// padded with repeated characters.
enum PaddingDirection { case left, right, center }
/// Returns a new string repeatedly padded with a character on
/// either or both sides of the source string.
///
/*
erica sadun, ericasadun.com
Core Geometry
*/
import Foundation
import QuartzCore

Firebase for Dummies

Visit http://console.firebase.google.com to begin. Most tutorial projects can be simple JSON storage sinks accessed from iOS.

Create a new Firebase database

  1. Click Add Project
  2. Enter a project name.
  3. Disable "Use the default settings for sharing Google Analytics for Firebase data".
  4. Click Continue.

Scavenger Hunt

Time: 10 minutes

  • Use Xcode documentation, online searches, and personal knowlege.
  • No helping each other. You're building your own search skills. We'll discuss strategies at the end.
  • Remember, iOS changes rapidly. You're looking for the latest APIs.
  • When you're done or time is up, send your answers privately to me in Zoom.

Find:

import UIKit
let crayonDictionary = ["Sepia": #colorLiteral(red: 0.6171875, green: 0.35546875, blue: 0.25, alpha: 1.0),
"Beaver": #colorLiteral(red: 0.5703125, green: 0.43359375, blue: 0.35546875, alpha: 1.0),
"Caribbean Green": #colorLiteral(red: 0.0, green: 0.796875, blue: 0.59765625, alpha: 1.0),
"Electric Lime": #colorLiteral(red: 0.796875, green: 0.99609375, blue: 0.0, alpha: 1.0),
"Gray": #colorLiteral(red: 0.54296875, green: 0.5234375, blue: 0.5, alpha: 1.0),
"Pacific Blue": #colorLiteral(red: 0.0, green: 0.61328125, blue: 0.765625, alpha: 1.0),
"Burnt Sienna": #colorLiteral(red: 0.91015625, green: 0.453125, blue: 0.31640625, alpha: 1.0),
"Manatee": #colorLiteral(red: 0.55078125, green: 0.5625, blue: 0.62890625, alpha: 1.0),

Scavenger Hunt

Time: 10 minutes

  • Use Xcode documentation, online searches, and personal knowlege.
  • No helping each other. You're building your own search skills. We'll discuss strategies at the end.
  • Remember, iOS changes rapidly. You're looking for the latest APIs.
  • When you're done or time is up, send your answers privately to me in Zoom.

Find: