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
@davidbalbert
davidbalbert / Text+String.swift
Last active November 12, 2024 00:27
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 October 9, 2024 18:45
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 October 14, 2024 16:16
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
@IanColdwater
IanColdwater / twittermute.txt
Last active November 17, 2024 02:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@kez
kez / slugify.sql
Created May 13, 2019 14:50 — forked from ianks/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (