This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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) |
NewerOlder