Skip to content

Instantly share code, notes, and snippets.

@TAATHub
TAATHub / ChipsSelection.swift
Last active April 17, 2025 18:21
Responsive Chips Selection
// Responsive Chips Selection
// See Also: https://youtu.be/T82izB2XBMA?si=Cnf6rGdyisG8ZWoX
import SwiftUI
struct Tag: Hashable {
var name: String
var color: Color
}

Unicode“同形字”

如果能提交任何您發現的錯誤,我將不勝感激。

肉 / 月 / 舟問題

舊字形的優點.png

肉 / 月

@1998code
1998code / ContentView.swift
Created February 28, 2025 14:08
Shimmer Effect 2025
// Copyright © 2025 MING
// MIT License
import SwiftUI
struct ContentView: View {
@State private var colorful: Bool = true
@State private var dragLocation: CGPoint = .zero
var body: some View {
#include <metal_stdlib>
using namespace metal;
float smoothMin(float x1, float x2, float k) {
float h = clamp(0.5 - 0.5 * (x2 - x1) / k, 0.0, 1.0);
return mix(x1, x2, h) - k * h * (1.0 - h);
}
float circleSDF(float2 point, float2 center, float radius) {
return length(point - center) - radius;
@morajabi
morajabi / FPSCounter.swift
Created December 29, 2024 19:16
An FPS Counter for macOS apps built for inline.chat
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 {
@f1shy-dev
f1shy-dev / best_SAE_trick.md
Last active April 24, 2025 04:55
sneakyf1shy's apple intelligence tutorial

the sneakyf1shy apple intelligence tutorial v2.0

Warning

This is patched as of iOS/iPadOS 18.1 DevBeta 5. If you want to follow this, stay on Beta 4.

This actually downloads the models, and is NOT just new SiriUI. Hence, this process is complex and probably not worth it.

⚠️ Prepare to be disappointed and annoyed, and have your time wasted! ⚠️

  • What does not work: Writing Tools, Memories, Reduce Interruptions, Image Eraser and other tools that are within official Apple Intelligence on supported devices.
import SwiftUI
// MARK: - ProgressRingScreen
/// A screen demonstrating a circular progress ring with a slider and control panel.
/// Uses a `ProgressRingViewModel` to track and animate the progress state.
struct ProgressRingScreen: View {
/// A view model that tracks and animates the progress value.
@State var viewModel = ProgressRingViewModel()
/* ==UserStyle==
@name gmail--mono
@namespace github.com/openstyles/stylus
@version 1.0.10
@description Implementation of https://x.com/guerriero_se/status/1792924958579900781.
@author Sebastiano Guerriero, Cyriaque 'cisoun' Skrapits
==/UserStyle== */
/*
* WARNING: Use Gmail's default theme with this!
@matthen
matthen / hello_world.py
Last active November 25, 2024 21:51
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@hoishing
hoishing / HowTo.md
Last active March 4, 2025 11:14
VSCode keybindings for Xcode

VSCode keybindings for Xcode

  • copy VSCode.idekeybindings to ~/Library/Developer/Xcode/UserData/KeyBindings
  • in Xcode preferences -> key bindings, select VSCode