I hereby claim:
- I am zackzachariah on github.
- I am zackzachariah (https://keybase.io/zackzachariah) on keybase.
- I have a public key whose fingerprint is 876C 2E52 8A74 0E5F 3D4B 81AA 4133 FB29 EF30 72A0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
extension Character { | |
/// An approximation of a spec-compatible "is this an emoji" check for the character. | |
/// Will recognize standard, flag, composite, tag emoji, and keycap emoji. | |
/// Unfortunately, will return true for "text presented" and malformed emoji too, | |
/// because I didn't do the whole CFG from Unicode. | |
var isEmoji: Bool { | |
// Empty character returns false | |
guard let first = self.unicodeScalars.first else { |
# Generates a build number that will consistently increase worldwide. | |
# Useful for coordinating build uploads between teams in different timezones. | |
# Format is "YYYYMMDDsss" where "sss" is the 1000ths slice of the day. | |
# For example, I just ran it in NYC at 5:55pm on 2020-04-27 and got back: 20200427913 | |
# If anyone else worldwide (with a correct system clock) runs it after this, | |
# they will get a bigger number guaranteed. | |
def generate_build_number() | |
time = Time.new.getutc | |
date = time.strftime("%Y%m%d") |
import React, { createContext, useContext } from "react"; | |
import { useWindowSize } from "react-use"; | |
const DisplayContext = createContext<"normal" | "compact">("normal"); | |
export default function Parent() { | |
const { width } = useWindowSize(); | |
let windowSizeDisplayContext = undefined; | |
if (width !== Infinity) { |
import React, { createContext, useContext, useEffect, useState } from "react"; | |
import { useWindowSize } from "react-use"; | |
const DisplayContext = createContext<"normal" | "compact">("normal"); | |
export default function Parent() { | |
const { width } = useWindowSize(); | |
const [windowSizeDisplayContext, setWindowSizeDisplayContext] = useState< | |
"normal" | "compact" |
// Copyright © 2020 Zack Sheppard. All rights reserved. | |
// Available under the MIT License | |
/// A few Sequence/Monad-like functions added to Optional | |
extension Optional { | |
/// Transform this optional into another type | |
@inlinable public func map<T>(_ transform: (Wrapped) throws -> T) rethrows -> T? { | |
if let inside = self { | |
return try transform(inside) | |
} else { |
// | |
// UIViewController+KeyboardAware.swift | |
// | |
// Created by Zack Sheppard. | |
// Copyright © 2020 Zack Sheppard. All rights reserved. | |
// Available under the MIT License | |
// | |
import UIKit |
// | |
// String+CountableRange.swift | |
// | |
// Created by Zack Sheppard on 8/30/20. | |
// Copyright © 2020 Zack Sheppard. All rights reserved. | |
// Available under the MIT License | |
// | |
import Foundation | |
/// This extension is available at |
// | |
// ShrinkingTableCell.swift | |
// ShrinkingTableCell | |
// | |
// Created by Zack Sheppard on 9/2/20. | |
// Copyright © 2020 Zack Sheppard. All rights reserved. | |
// Available under the MIT License | |
// Available at https://gist.github.com/zackdotcomputer/d365bfa5cd7e4a38d45c078b09459da3 | |
// |
// | |
// Decodable+Graceful.swift | |
// Graceful Decodable | |
// | |
// Created by Zack Sheppard on 9/10/20. | |
// Copyright © 2020 Zack Sheppard. All rights reserved. | |
// Available under the MIT License | |
// Available at https://gist.github.com/zackdotcomputer/81b8545e3ce81128a299996814823963 | |
// |