Skip to content

Instantly share code, notes, and snippets.

View Widcket's full-sized avatar

Rita Zerrizuela Widcket

View GitHub Profile
@EricRabil
EricRabil / DispatchQueue+Current.swift
Created April 27, 2022 16:29
Get current dispatch queue in Swift
extension DispatchQueue {
private static let dispatch_get_current_queue = dlsym(dlopen(nil, RTLD_GLOBAL), "dispatch_get_current_queue")
static var current: DispatchQueue {
dispatch_get_current_queue.map {
unsafeBitCast($0, to: (@convention(c) () -> Unmanaged<DispatchQueue>).self)().takeUnretainedValue()
} ?? .global(qos: .background)
}
}
@hecht1962
hecht1962 / ipstocrash.pl
Last active June 14, 2025 07:37
Convert an IPS crash report (.ips) to the legacy crash report format (.crash)
#!/usr/bin/perl
##
## This script converts an IPS crash report (.ips) to the legacy crash report format.
##
## The .ips file (JSON) is read from STDIN and the legacy crash report is written to
## STDOUT.
##
use strict;
@Jomy10
Jomy10 / rust_in_swift.md
Last active December 30, 2025 02:55
Calling Rust library from Swift code (creating executable)

Calling a Rust library from Swift

This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.

Let's go ahead and create a folder containing all our sources:

mkdir swift-rs && cd $_
@insidegui
insidegui / CodableReference.swift
Created January 4, 2022 18:03
Property wrapper that allows for properties to be encoded as references by ID and resolved while decoding.
protocol ReferenceEncodable: Identifiable {
static var referenceStorageKey: CodingUserInfoKey { get }
}
extension ReferenceEncodable {
static var referenceStorageKey: CodingUserInfoKey {
CodingUserInfoKey(rawValue: String(describing: Self.self) + "ReferenceStorage")!
}
}
@bergusman
bergusman / README.md
Last active July 21, 2025 22:02
Keychain
@helje5
helje5 / servedocc.swift
Last active March 19, 2026 16:27
Small Swift Script to serve `.doccarchive`s to the browser
#!/usr/bin/swift sh
import MacroExpress // @Macro-swift
// MARK: - Parse Commandline Arguments & Usage
func usage() {
let tool = path.basename(process.argv.first ?? "servedocc")
print(
"""
//
// CodableExtensions.swift
// 7-Eleven
//
// Created by Raja Sekhar Chiderae on 1/14/19.
// Copyright © 2019 self. All rights reserved.
//
import Foundation
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active March 25, 2026 02:25
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
@dagronf
dagronf / DSFKeyedArchiverCodable.swift
Created November 18, 2019 01:22
A swift wrapper class to support Codable via NSKeyedArchiver
//
// DSFKeyedArchiverCodable.swift
// QR Generator
//
// Created by Darren Ford on 18/11/19.
// Copyright © 2019 Darren Ford. All rights reserved.
//
import Foundation