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
@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)
@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.
//
import SwiftUI
struct HarmonicButton: View {
var body: some View {
Button(
action: {},
label: {}
)
.frame(width: 240.0, height: 70.0)
.buttonStyle(HarmonicStyle())
@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)
//
// 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
@unrealwill
unrealwill / collisionLSH.py
Created August 8, 2021 10:20
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()
@tkafka
tkafka / listAllEventListeners.js
Last active January 19, 2026 18:41 — forked from dmnsgn/listAllEventListeners.js
List all event listeners in a document
console.table((function listAllEventListeners() {
const allElements = Array.prototype.slice.call(document.querySelectorAll('*'));
allElements.push(document); // we also want document events
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
let elements = [];
for (let i = 0; i < allElements.length; i++) {
@KargJonas
KargJonas / regex-html-tags.md
Last active May 22, 2021 12:34
RegEx' to select HTML tags.
@0xmachos
0xmachos / Keychain.md
Last active July 28, 2025 06:29
Useful resources for working with iOS/ macOS Keychain API

Keychain API

kSecAttrAccessible Mapping

Protection Domain (pdmn) Keychain Accessibility Values
ck kSecAttrAccessibleAfterFirstUnlock
cku kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
dk kSecAttrAccessibleAlways
akpu kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
@valfer
valfer / sendPush.txt
Last active April 29, 2024 12:29
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)