Skip to content

Instantly share code, notes, and snippets.

View akerenyi's full-sized avatar

Adam Kerenyi akerenyi

  • Berlin, Germany
View GitHub Profile
@PaulWagener
PaulWagener / Keychain.swift
Created November 1, 2017 07:09
Easy Keychain use with Swift 4
//
// Keychain.swift
// SecKeychain
//
// Created by Paul Wagener on 01-11-17.
// Copyright © 2017 Paul Wagener. All rights reserved.
//
import Foundation
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 29, 2024 14:26
Swift Concurrency Manifesto
localeIdentifier Description
eu Basque
hr_BA Croatian (Bosnia & Herzegovina)
en_CM English (Cameroon)
en_BI English (Burundi)
rw_RW Kinyarwanda (Rwanda)
ast Asturian
en_SZ English (Swaziland)
he_IL Hebrew (Israel)
ar Arabic
@sgr-ksmt
sgr-ksmt / file.swift
Created September 26, 2016 05:55
Safe DispatchQueue.main.sync (Swift3.0)
extension DispatchQueue {
class func mainSyncSafe(execute work: () -> Void) {
if Thread.isMainThread {
work()
} else {
DispatchQueue.main.sync(execute: work)
}
}
class func mainSyncSafe<T>(execute work: () throws -> T) rethrows -> T {
@briancroom
briancroom / Swift.md
Last active February 6, 2024 18:26
How to create a Swift modular library

I am trying to determine if it is possible to build a Swift dynamic library which is itself composed of one of more private modules, without needing to expose to that fact to outside users. My hope was that I could build the private module as a static library, which would be linked into the primary (dynamic) library. The dylib could then be deployed together with its swiftmodule and swiftdoc and be imported, with the private module and its symbols not being exposed at all.

Unfortunately, what I'm currently observing seems to indicate that the private module's swiftmodule also has to be available for the primary library to be successfully imported.

This can be reproduced as follows. I have the following directory structure:

./Greeter/Logger/Logger.swift:

public func log(_ message: String) {
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@ColinEberhardt
ColinEberhardt / Swift Events
Created February 11, 2015 09:15
An eventing mechanism for Swift
/// An object that has some tear-down logic
public protocol Disposable {
func dispose()
}
/// An event provides a mechanism for raising notifications, together with some
/// associated data. Multiple function handlers can be added, with each being invoked,
/// with the event data, when the event is raised.
public class Event<T> {
@staltz
staltz / introrx.md
Last active July 6, 2024 17:07
The introduction to Reactive Programming you've been missing
@jpotts
jpotts / AspectExample.java
Last active July 18, 2023 14:54
Creating aspect-defined properties in CMIS with Alfresco
package com.someco.cmis.examples;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.chemistry.opencmis.client.api.Document;
@wacko
wacko / gist:5577187
Last active January 6, 2024 07:31
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0