- copy
VSCode.idekeybindings
to~/Library/Developer/Xcode/UserData/KeyBindings
- in Xcode preferences -> key bindings, select VSCode
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 AppKit | |
import Charts | |
import CoreVideo | |
import SwiftUI | |
struct FPSMeasurement: Identifiable, Equatable { | |
let id: Int | |
let fps: Int | |
static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool { |
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 Foundation | |
import GRDB | |
// MARK: - DB main class | |
public final class AppDatabase: Sendable { | |
public let dbWriter: any DatabaseWriter | |
public init(_ dbWriter: any GRDB.DatabaseWriter) throws { | |
self.dbWriter = dbWriter |
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 | |
struct FormStateData { | |
var loading: Bool | |
var error: String? | |
var succeeded: Bool? | |
} | |
// A helper for easier state management for simple forms | |
class FormState: ObservableObject { |
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
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3 | |
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592 | |
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code. | |
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices. | |
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning. | |
- Follow the user’s requirements carefully & to the letter. |
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
use objc::{msg_send, sel, sel_impl}; | |
use rand::{distributions::Alphanumeric, Rng}; | |
use tauri::{ | |
plugin::{Builder, TauriPlugin}, | |
Manager, Runtime, Window, | |
}; // 0.8 | |
const WINDOW_CONTROL_PAD_X: f64 = 15.0; | |
const WINDOW_CONTROL_PAD_Y: f64 = 23.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
class TimeElapsed: CustomStringConvertible { | |
private let startTime: CFAbsoluteTime | |
private var endTime: CFAbsoluteTime? | |
init() { | |
startTime = CFAbsoluteTimeGetCurrent() | |
} | |
var description: String { | |
time |
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
{ | |
"$schema": "https://zed.dev/schema/themes/v0.1.0.json", | |
"name": "Vesper", | |
"author": "Rauno Freiberg", | |
"themes": [ | |
{ | |
"name": "Vesper", | |
"appearance": "dark", | |
"style": { | |
"border": "#101010", |
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
// | |
// MultiPartFormData.swift | |
// | |
import Foundation | |
/* Example Call site: */ | |
func upload(imageData: Data) async throws { | |
guard let url = URL(string: "https://example.com/upload") else { return } | |
var multipartFormData = MultipartFormData() |
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
/** | |
* TypeScript currently lacks a way of typing a record of keys only but not values. | |
* we need this because we want an object of typed keys but we want to leave the values inferred. | |
* thankfully, we can do this with generics. This function allows the second generic's values to be inferred | |
* so that our object is fully type safe for hugely complex types, but we can guarantee that all the keys we need exist. | |
* It's not perfect, but it gets the job done for the time being | |
*/ | |
export function ensureKeys<T>() { | |
/** | |
* Function that returns the value that gets put in, values are type-safely inferred |
NewerOlder