If you're used to solving cryptic puzzles, or deciphering texts using crypt-analytical cribs, it can be useful to know the relative frequency of letters in the distribution of words. Wordle has a built-in list of 5-letter words. That list isn't the same as all of the five letter words in the dictionary, or even only the common ones. Perfectly common words like 'tudor' are omitted. This gist contains a few useful tables that are worth familiarizing yourself with if you want to solve wordle puzzles logically.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are a spymaster working for the BLUE TEAM. You will be presented with a list of words that both the BLUE TEAM and RED TEAM have. | |
You are trying to think of a one-word clue that relates to one or more of the words your team is trying to guess. | |
For example, if the word "nut" and "bark" is in your list, your one-word clue could be "tree", since both are found on trees. | |
When you have a good clue, you say it. You also say one number, which tells your teammates how many codenames are related to your clue. | |
You are allowed to give a clue for only one word, (e.g., "CASHEW, 1") but it's fun to try for multiple words. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import UIKit | |
public final class HostingView: UIView { | |
public init(@ViewBuilder content: () -> some View) { | |
super.init(frame: .zero) | |
let contentView = UIHostingConfiguration(content: content) | |
.margins(.all, 0) | |
.makeContentView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private protocol SilenceDeprecationForUIScreenWindows { | |
var screens: [UIScreen] { get } | |
} | |
private final class SilenceDeprecationForUIScreenWindowsImplementation: SilenceDeprecationForUIScreenWindows { | |
@available(iOS, deprecated: 16) | |
var screens: [UIScreen] { UIScreen.screens } | |
} | |
extension UIScreen { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Blur.swift | |
// | |
// | |
// Created by Ethan Lipnik on 11/21/22. | |
// | |
import SwiftUI | |
private struct BlurModifier: ViewModifier { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CompareEquatableProperties.swift | |
// ListableUI | |
// | |
// Created by Kyle Van Essen on 7/28/22. | |
// | |
import Foundation | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import Foundation | |
// NOTE: This playground shows how to use Swift's AttributedString with Markdown. | |
// | |
// This code was used to display Markdown content in the Tot iOS Widget <https://tot.rocks> | |
// MARK: - Helpful Links | |
// NOTE: The following links helped me figure this stuff out. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if DEBUG | |
/* | |
This fixes SwiftUI previews not rendering translucent materials correctly by | |
swizzling a couple of properties on NSWindow. | |
Just drop into your project and add to the target being previewed (or something it links against). | |
Notice the #if DEBUG, so this code won't end up in release builds. It also checks for the | |
XCODE_RUNNING_FOR_PREVIEWS environment variable so that it won't affect regular debug builds of the app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Error { | |
var code: Int { return (self as NSError).code } | |
var domain: String { return (self as NSError).domain } | |
var userInfo: [String:Any] { return (self as NSError).userInfo } | |
func timeAfterWhichToRetry(retryCount: Int) -> TimeInterval? { | |
// CloudKit suggests us retry too often, so slow us down as we retry a lot, up to 5 minutes | |
if let suggestedTimeout = suggestedTimeAfterWhichToRetry { | |
if suggestedTimeAfterWhichToRetry == 0 { | |
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A view that can flip between its "front" and "back" side. | |
// | |
// Animation implementation based on: | |
// Chris Eidhof, Keyframe animations <https://gist.github.com/chriseidhof/ea0e435197f550b195bb749f4777bbf7> | |
import SwiftUI | |
// MARK: - Chris's keyframe animation design | |
struct Keyframe<Data: Animatable> { |
NewerOlder