Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| public enum InputField<Value: Equatable> { | |
| /// The state of current input validation | |
| public enum InputValidation: Equatable { | |
| /// A value that has undergone validation and is found to be valid. | |
| case valid(Value) | |
| /// A value that has undergone validation and is found to be invalid. | |
| /// Optionally, a feedback message can be displayed to the user | |
| /// to let them know what the issue with their input is. | |
| /// For example: "Please enter a value between 10 and 100." | |
| case invalid(Value, feedback: String?) |
| import SwiftUI | |
| /// A wrapper view that provides a mutable Binding to its content closure. | |
| /// | |
| /// Useful in Xcode Previews for interactive previews of views that take a Binding. | |
| struct Stateful<Value, Content: View>: View { | |
| var content: (Binding<Value>) -> Content | |
| @State private var state: Value | |
| init(initialState: Value, @ViewBuilder content: @escaping (Binding<Value>) -> Content) { |
| // Taken from https://github.com/pointfreeco/swift-snapshot-testing/pull/628/files | |
| import Foundation | |
| import SwiftUI | |
| @testable import SnapshotTesting | |
| #if os(iOS) || os(tvOS) | |
| import CoreImage.CIFilterBuiltins | |
| import UIKit |
| /** | |
| * General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts. | |
| * | |
| * Note that this uses an older fork of stable-diffusion | |
| * with the 'txt2img.py' script, and that script was modified to | |
| * support the --outfile command. | |
| */ | |
| var { spawn, exec } = require("child_process"); | |
| var path = require("path"); |
| # Clone llama.cpp | |
| git clone https://github.com/ggerganov/llama.cpp.git | |
| cd llama.cpp | |
| # Build it | |
| make clean | |
| LLAMA_METAL=1 make | |
| # Download model | |
| export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |
Swift's automatically provided memberwise initializer is a powerful feature. However, when an explicit initializer is present, Swift omits its memberwise initializer:
struct Person: Decodable {
let name: String
enum CodingKeys: CodingKey {
case name
As of August 28th, 2025, Expert LSP has been released: https://github.com/elixir-lang/expert
Although still a work in progress, the plan is for the other three LS implementations to be archived. I may try to come up with a new way to track Expert's featureset, but I would probably contribute that back to Expert as documentation.
As of August 15, 2024, it's been announced that the three projects bein compared here will soon merge! See the official Elixir blog post for more details: https://elixir-lang.org/blog/2024/08/15/welcome-elixir-language-server-team/
Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is