Skip to content

Instantly share code, notes, and snippets.

View mattt's full-sized avatar
🌴
On vacation

Mattt mattt

🌴
On vacation
View GitHub Profile

This page is now depreacted!

Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.

The Wisdom of Quinn

Informative DevForum posts from everyone's favorite DTS member.

(Arranged newest to oldest)

@orta
orta / review.md
Created November 5, 2020 21:10
Orta's self review - late 2020

Core Priorities

  1. Lower the barrier of entry to adopting and understanding TypeScript. North star.

  2. Understand the TypeScript Codebase enough to provide useful API documentation and fix bugs. Validated by having a more comprehensive set of tools for people to understand how the language and tooling works.

  3. Make contributing to TypeScript easier, and reduce the amount of work maintainers need to do. Validated probably by the number of open PRs, and the number of external contributors per release.

  4. Make it easier to people wanting to build tooling around TypeScript. Validated by seeing more usage of tools like the community discord, people shipping tools with TypeScript support by default etc.

/*:
Joe Groff:
> In a lot of the ways people use dictionaries/maps/hashtables, there's a type dependency between
> the keys and values, but most mainstream typed languages provide homogeneously-typed maps.
> Are there any that try to preserve more interesting type relationships between key and value?
> https://twitter.com/jckarter/status/1278739951568314368
> As one example, it's common for specific keys to be associated with specific types, like in
> {"name": "Tanzy", "age": 13}, "name" should always map to a string, and "age" to a number.
@nicklockwood
nicklockwood / main.swift
Created May 18, 2020 22:58
A simple one-file language parser and compiler test
import Foundation
enum LexingError: Error, Equatable {
case syntaxError(String)
case unexpectedEOF
}
enum ParsingError: Error {
case expected(String)
case unexpectedToken(Token)
@mattt
mattt / CTExposureDetectionSession+Extensions.swift
Last active April 27, 2020 23:51
Theoretical convenience API for working with Apple's ContactTracing framework
import ContactTracing
extension CTExposureDetectionSession {
func addPositiveDiagnosisKeys(batching keys: [CTDailyTracingKey], completion: CTErrorHandler) {
if keys.isEmpty {
completion(nil)
} else {
let cursor = keys.index(keys.startIndex, offsetBy: maxKeyCount, limitedBy: keys.endIndex) ?? keys.endIndex
let batch = Array(keys.prefix(upTo: cursor))
let remaining = Array(keys.suffix(from: cursor))
import Foundation
import Ink
func tidy(_ inputStr: String) -> String {
let task = Process()
task.launchPath = "/usr/local/Cellar/tidy-html5/5.6.0/bin/tidy"
task.arguments = ["--show-body-only", "yes", "--show-info", "no", "--show-warnings", "no", "--show-errors", "0"]
let input = Pipe()
let output = Pipe()
@mattt
mattt / UIViewControllerPreview.swift
Last active January 8, 2024 23:09
Generic structures to host previews of UIView and UIViewController subclasses.
import UIKit
#if canImport(SwiftUI) && DEBUG
import SwiftUI
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
let viewController: ViewController
init(_ builder: @escaping () -> ViewController) {
viewController = builder()
}
@keith
keith / simctl-commands.txt
Last active December 7, 2022 23:27
All the subcommands of `xcrun simctl` (including ones that aren't listed in `simctl help`) LC_SOURCE_VERSION 776.1 (Xcode 13.0 beta 5)
addmedia
addphoto
addvideo
appinfo
boot
bootstatus
clone
create
darwinup
delete
@mxcl
mxcl / detweet.swift
Last active December 23, 2023 23:22
Delete all tweets and favorites older than two months ago. Instructions in comment.
#!/usr/bin/swift sh
import Foundation
import PromiseKit // @mxcl ~> 6.5
import Swifter // @mattdonnelly == b27a89
let swifter = Swifter(
consumerKey: "FILL",
consumerSecret: "ME",
oauthToken: "IN",
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html"
@mattt
mattt / bridge.swift
Last active June 14, 2023 11:47
Example usage of @mxcl's swift-sh
#!/usr/bin/swift sh
import DeckOfPlayingCards // @NSHipster ~> 4.0.0
import PlayingCard
import Cycle // @NSHipster == bb11e28
class Player {
var name: String
var hand: [PlayingCard] = []