Skip to content

Instantly share code, notes, and snippets.

View gali8's full-sized avatar

Daniele - mokapp.com gali8

View GitHub Profile
@algal
algal / vmstatistics64.swift
Last active August 16, 2022 07:45
Get virtual memory usage on iOS or macOS
import Darwin
import Foundation
// known good: Swift 5
// runs on macOS, probably works on iOS (but haven't tried)
/// Wraps `host_statistics64`, and provides info on virtual memory
///
/// - Returns: a `vm_statistics64`, or nil if the kernel reported an error
///
@klemenzagar91
klemenzagar91 / MulticastDelegateV2.swift
Created June 22, 2017 12:16
Multicast Delegate with hash table
class MulticastDelegate <T> {
private let delegates: NSHashTable<AnyObject> = NSHashTable.weakObjects()
func add(delegate: T) {
delegates.add(delegate as AnyObject)
}
func remove(delegate: T) {
for oneDelegate in delegates.allObjects.reversed() {
if oneDelegate === delegate as AnyObject {
@mat
mat / Readme.markdown
Last active February 19, 2024 07:46
apple-app-site-association —with examples

“apple-app-site-association” file

One file for each domain, both www.example.com and example.com need separate files:

{
    "applinks": {
        "apps": [],
        "details": {
 "9JA89QQLNQ.com.apple.wwdc": {
@GilLevi
GilLevi / README.md
Last active July 25, 2023 18:05
Age and Gender Classification using Convolutional Neural Networks