Skip to content

Instantly share code, notes, and snippets.

View spookyd's full-sized avatar

Luke Davis spookyd

  • San Fransisco, CA
View GitHub Profile
//
// CacheAsyncImage.swift
//
// Created by Costantino Pistagna on 08/02/23.
//
import SwiftUI
struct CacheAsyncImage<Content, Content2>: View where Content: View, Content2: View {
private let url: URL?
@spookyd
spookyd / Create-xcframework-from-swiftpackage.md
Created November 14, 2022 02:57 — forked from the-yuyut/Create-xcframework-from-swiftpackage.md
Solution of make XCFramework from Swift Package

before execute, gen xcode project by

swift package generate-xcodeproj

and configure the build setting as you need

then excute the script with two argument

  1. the name of .xcodeproj
  2. the sheme to gen (may be different due to auto generate xcode project)
@spookyd
spookyd / auto_testflight.sh
Created December 27, 2021 22:32 — forked from twolights/auto_testflight.sh
TestFlight upload automation script
#!/bin/bash
# Modified from the script by Justin Miller
# Source: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode/
API_TOKEN='<YOUR TESTFLIGHT API TOKEN>'
TEAM_TOKEN='<YOUR TESTFLIGHT TEAM TOKEN>'
SIGNING_IDENTITY='<YOUR SIGNING IDENTITY>'
PROVISIONING_PROFILE="$HOME/Library/MobileDevice/Provisioning Profiles/<NAME-OF-YOUR-PROVISIONING-PROFILE>"
@spookyd
spookyd / CookieManager.swift
Created September 9, 2021 00:18 — forked from harshaspatil/CookieManager.swift
WKWebview Cookie Sync Example
import Foundation
import WebKit
/// Class which syncronizes cookies for the webview.
internal final class CookieManager {
/// Cookies from http cookie store.
var httpCookies: [HTTPCookie] {
return HTTPCookieStorage.shared.cookies ?? [HTTPCookie]()
}
@spookyd
spookyd / System Design.md
Created April 17, 2020 05:10 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@spookyd
spookyd / NBResponderChainUtilities.h
Created October 20, 2017 12:04 — forked from n-b/NBResponderChainUtilities.h
Chain Responder Debugging Methods
//
// NBResponderChainUtilities.h
//
// Created by Nicolas @ bou.io on 19/04/13.
//
#import <UIKit/UIKit.h>
@interface UIView (NBResponderChainUtilities)
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder
//: Convenience functions/extension on top of GCD.
import Dispatch
var MainQueue: dispatch_queue_t { return dispatch_get_main_queue() }
func GlobalQueue(qos: dispatch_qos_class_t = .Default) -> dispatch_queue_t
{
return dispatch_get_global_queue(qos, 0)
}