erica’s gists · GitHub
Skip to content Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Instantly share code, notes, and snippets. Erica Sadun erica 3.3k followers · 10 following Denver, CO http://ericasadun.com View GitHub Profile Recently created Least recently created Recently updated Least recently updated 1 file 0 forks 1 comment 0 stars erica / Book Ideas.md Last active January 22, 2022 05:37 Book Ideas Preview Power : AKA free, fun, no fotoshop.
If you've taken my webinar on this, you pretty much know what's involved. Lots of stuff with a surprisingly powerful features that not a lot of people know about. ed-ucation : Write a book on using ed because it's the best editor ever and it's more or less guaranteed to be available on every *nix ever. g/re/p for life. Plus nods to sed, vi, etc. hidden macOS gems : uncovering the coolness that's already there on your machine.
Swift at the Command Line : from emitting proper exit codes to using the argument parser, input and output streams, etc. More involved than the webinar, and can extend to coloring text at the command line, curses, etc depending on how obscure I get. Or I can pull back and focus just on the argument parser. Xcode Power Up : If you've attended my webinar, you know what this is. Twists and secrets. Zero to SwiftPM : If you've attended my webinar, you know what this is. **N Unix Obscurities (BSD and GN 1 file 0 forks 0 comments 0 stars erica / wordle.swift Last active January 10, 2022 00:36 import Foundation let string = """ Wordle 204 6/6 ⬜⬜⬜⬜🟨 🟨🟨⬜⬜⬜ ⬜🟩🟩🟨⬜ ⬜🟩🟩⬜🟩 ⬜🟩🟩⬜🟩 1 file 0 forks 0 comments 0 stars erica / verbosity.md Last active July 15, 2020 15:42 Last login: Wed Jul 15 09:29:59 on ttys002 /bin/bash -c 'arch -arch x86_64 '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/darwin-debug' --unix-socket=/tmp/V4f5hE --arch=x86_64 --working-dir '/Users/ericasadun/Library/Developer/Xcode/DerivedData/Test-gwehknnihlcsiucsovtbnlrdtfun/Build/Products/Debug' --disable-aslr --env='__XCODE_BUILT_PRODUCTS_DIR_PATHS=/Users/ericasadun/Library/Developer/Xcode/DerivedData/Test-gwehknnihlcsiucsovtbnlrdtfun/Build/Products/Debug' --env='MallocNanoZone=0' --env='CA_DEBUG_TRANSACTIONS=0' --env='NSUnbufferedIO=YES' --env='CA_ASSERT_MAIN_THREAD_TRANSACTIONS=0' --env='PWD=/Users/ericasadun/Library/Developer/Xcode/DerivedData/Test-gwehknnihlcsiucsovtbnlrdtfun/Build/Products/Debug' --env='DYLD_LIBRARY_PATH=/Users/ericasadun/Library/Developer/Xcode/DerivedData/Test-gwehknnihlcsiucsovtbnlrdtfun/Build/Products/Debug:/usr/lib/system/introspection' --env='LD_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/../SharedFrameworks/' --env='_ XPC_DYLD_LIBRARY 1 file 0 forks 0 comments 0 stars erica / combine4.swift Created July 11, 2020 17:58 import Foundation import Combine // Mapping // Arrays are sequences. // Adding a transform (here, map) after it affects the output values sent to a subscriber/sink print("as tens") [6, 9, 4, 2].publisher.map({ $0 * 10 }).sink { print($0) } 1 file 0 forks 0 comments 0 stars erica / combine3.swift Created July 11, 2020 03:57 import Cocoa import Combine import ObjectiveC import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution = true enum Action { static func run(after delay: Double, action: @escaping () -> Void) { let delayTime = UInt64(delay * Double(NSEC_PER_SEC)) 1 file 0 forks 0 comments 0 stars erica / combine2.swift Created July 11, 2020 03:56 import Cocoa import Combine // ## Subjects // A `Subject` is a special publisher that enables you to inject values into a stream. // Just call the `send(_:)` method. // "This can be useful for adapting existing imperative code to the Combine model." // WHAT'S THERE: 1 file 0 forks 0 comments 0 stars erica / combine1.swift Created July 11, 2020 01:52 import Foundation import Combine // # PUBLISHERS // // Publishers are a namespace for types that serve as publishers. // "The various operators defined as extensions on ``Publisher`` implement their functionality as classes or structures that extend this enumeration.
For example, the `contains(_:)` operator returns a `Publishers.Contains` instance." // ``` // public enum Publishers { // } 1 file 0 forks 1 comment 0 stars erica / attempts.swift Last active July 7, 2020 17:07 Olivier: I think that's one of the rare cases where fallthough is acceptable import XCTest class Tester: XCTestCase { func testit() { XCTAssertEqual("a", switchTheFallthroughOrder(foo: .a)) XCTAssertEqual("b", switchTheFallthroughOrder(foo: .b("x"))) XCTAssertEqual("c", switchTheFallthroughOrder(foo: .b("cx"))) XCTAssertEqual("c", switchTheFallthroughOrder(foo: .c)) 1 file 0 forks 0 comments 0 stars erica / discouraged.md Last active July 5, 2020 19:36 Expanding available to introduce discouraged Proposal: SE-nnnnnnnn Authors: Erica Sadun , Chris Lattner Review Manager: TBD Status: Awaiting implementation 1 file 0 forks 0 comments 1 star erica / pirate.txt Last active November 29, 2020 20:39 ********This Text Adventure is Copyright 1993, by Erica Sadun******** ALL RIGHTS RESERVED.
Known bugs and differences from Infocom games? say ‘news’. Unfamiliar with certain words? say ‘jargon’ PIRATING To hack and to slash with the best of the best Means you must have a spirit which is steely and cold You must fight without mercy, from earliest dawn The heart of a pirate is ruthless and bold. Richard T. Pettyheart, Scholar Treatise on Pirates, 1638 Newer Older You can’t perform that action at this time.