Skip to content

Instantly share code, notes, and snippets.

View samhenrigold's full-sized avatar
📱
out with rach, cell’s hot if u r

samhenrigold

📱
out with rach, cell’s hot if u r
View GitHub Profile
@stephancasas
stephancasas / IntelligenceUIPlatterView.swift
Created February 14, 2025 23:49
A SwiftUI expression of Apple Intelligence' NSIntelligenceUIPlatterView — used to accent intelligence-enabled UI components.
//
// IntelligenceUIPlatterView.swift
//
// Created by Stephan Casas on 2/13/25.
//
import SwiftUI
import AppKit
import Combine
@available(iOS 15.0, *)
public struct RichTextEditor : SwiftUICore.View {
public init(text: SwiftUICore.Binding<Foundation.AttributedString>)
@_Concurrency.MainActor @preconcurrency public var body: some SwiftUICore.View {
get
}
@available(iOS 15.0, *)
public typealias Body = @_opaqueReturnTypeOf("$s7SwiftUI14RichTextEditorV4bodyQrvp", 0) __
}
@available(*, unavailable)
@davidbalbert
davidbalbert / Text+String.swift
Last active January 7, 2025 01:21
Hack to extract a String from SwiftUI.Text
// Cursed! Do not use!
// Supports most, but not all Text initializers.
import SwiftUI
extension FormatStyle {
func format(any value: Any) -> FormatOutput? {
if let v = value as? FormatInput {
return format(v)
@lukaskubanek
lukaskubanek / SwiftUIListRowHighlightFix.swift
Last active March 26, 2024 17:51
A workaround for fixing SwiftUI’s list row highlighting behavior by preventing unwanted delays
import InterposeKit
import SwiftUI
/// A workaround for an issue in SwiftUI related to delayed highlighting of list rows upon user
/// interaction, rendering it inconsistent with UIKit.
///
/// This fix implements the solution proposed by Léo Natan and utilizes `InterposeKit` by Peter
/// Steinberger to modify the behavior of `UICollectionViewCell` instances used internally
/// by SwiftUI.
///
@adalinesimonian
adalinesimonian / block-the-blue.md
Last active December 27, 2024 22:02
Block all verified Twitter accounts on screen
//
// ContentView.swift
// MadeForYouCard
//
// Created by AppleDesignDev on 1/24/22.
//
import SwiftUI
struct ContentView: View {
@davelevine
davelevine / rewrite-subdomain-url-for-b2-with-cloudflare-cdn.md
Last active January 15, 2023 02:14
Rewrite Subdomain URL for B2 with Cloudflare CDN

Remove B2 /file/<bucket-name> Prefix

While the article from James Ross is solid and works very well with images, I found it fell short with any streaming video with the Bandwidth Alliance (to be fair, the article mentions nothing about videos, only images). Although the URL was being rewritten, it didn't seem to be handling video properly and even short videos were taking a long time to load.

That being said, the following seems to work perfectly...

Note: None of this code is mine. I'm basically standing on the shoulders of giants.

@enxg
enxg / quoraNoLogin.user.js
Last active April 3, 2022 03:03
View Quora questions without logging in.
// ==UserScript==
// @name Quora No Login
// @namespace http://github.com/RedS-DEV
// @version 1.0
// @description View Quora questions without logging in.
// @author github.com/RedS-DEV
// @match https://www.quora.com/*
// @grant none
// ==/UserScript==
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active January 24, 2025 03:26
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support
@rudolfschmidt
rudolfschmidt / free-3-letter-domains.sh
Created June 2, 2020 21:04
Check Free 3 Letter Domains
#!/usr/bin/env bash
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for a in "${array[@]}"
do
for b in "${array[@]}"
do
for c in "${array[@]}"
do