Skip to content

Instantly share code, notes, and snippets.

View 0xWDG's full-sized avatar
💻
Hacking my way around

Wesley de Groot 0xWDG

💻
Hacking my way around
View GitHub Profile
//
// ContentView.swift
// ActivityRingAnimation WatchKit Extension
//
// Created by AppleDesignDev on 1/25/22.
//
import SwiftUI
struct ContentView: View {
var body: some View {
TimelineView(.periodic(from: .now, by: 1.0)) { timeline in
@sainecy
sainecy / RunBlocking.swift
Last active October 10, 2023 03:08
Run asynchronous blocks synchronous in swift. As Kotlin runBlocking. ONLY FOR TEST PURPOSES. Async code MUST BE RUNS ONLY ASYNCHRONOUSLY IN PRODUCTION!
import Foundation
private final class RunBlocking<T, Failure: Error> {
fileprivate var value: Result<T, Failure>? = nil
}
extension RunBlocking where Failure == Never {
func runBlocking(_ operation: @Sendable @escaping () async -> T) -> T {
Task {
let task = Task(operation: operation)
import SwiftUI
struct HarmonicButton: View {
var body: some View {
Button(
action: {},
label: {}
)
.frame(width: 240.0, height: 70.0)
.buttonStyle(HarmonicStyle())
@1998code
1998code / reTicTacCHA.swift
Created November 17, 2025 15:03
reTicTacCHA
//
// reTicTacCHA.swift
// Tic-Tac-Toe reCAPTCHA
//
// A fun reCAPTCHA-styled Tic-Tac-Toe game where users must beat an AI
// to prove they're human. Features glass morphism UI inspired by iOS 18+
// and a minimax AI opponent with configurable difficulty.
//
// Created by Ming on 17/11/2025.
//
@Mcrich23
Mcrich23 / _UIViewGlass.swift
Last active January 3, 2026 20:56
A function that creates a _UIViewGlass object with the correctly numbered variant. All in swift!
public func _UIViewGlass(variant: Int) -> NSObject? {
let glassClass = objc_lookUpClass("_UIViewGlass")! as AnyObject
let glass = glassClass._alloc()._init(variant: variant)
return glass as? NSObject
}
/// Registers Objective-C methods Swift needs.
fileprivate final class PrivateSelectors: NSObject {
@objc(alloc)