This file contains 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
env > env.txt | |
instruments -s devices > devices.txt | |
#! /bin/sh -e | |
# This script demonstrates archive and create action on frameworks and libraries | |
# Based on script by @author Boris Bielik | |
# Release dir path | |
OUTPUT_DIR_PATH="${PROJECT_DIR}/XCFramework" | |
function archivePathSimulator { |
This file contains 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 SwiftUI | |
import enum Accelerate.vDSP | |
struct AnimatableVector: VectorArithmetic { | |
static var zero = AnimatableVector(values: [0.0]) | |
static func + (lhs: AnimatableVector, rhs: AnimatableVector) -> AnimatableVector { | |
let count = min(lhs.values.count, rhs.values.count) | |
return AnimatableVector(values: vDSP.add(lhs.values[0..<count], rhs.values[0..<count])) | |
} |
This file contains 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 | |
// DeleteMe | |
// | |
// Created by Chris Eidhof on 02.02.21. | |
// | |
import SwiftUI | |
/* |
This file contains 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 XCTest | |
/// An expectation that is fulfilled when a Key Value Observing (KVO) condition | |
/// is met. It's variant of `XCTKVOExpectation` with support for native Swift | |
/// key paths. | |
final class KVOExpectation: XCTestExpectation { | |
private var kvoToken: NSKeyValueObservation? | |
/// Creates an expectation that is fulfilled when a KVO change causes the | |
/// specified key path of the observed object to have an expected value. |
This file contains 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
#!/usr/bin/env bash | |
# | |
# Author: Stefan Buck | |
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | |
# | |
# | |
# This script accepts the following parameters: | |
# | |
# * owner | |
# * repo |
This file contains 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 struct Promise<T> { | |
typealias Fulfiller = (T) -> (Void) | |
typealias Rejecter = (Void) -> (Void) | |
typealias Resolver = (_ fulfill: @escaping Fulfiller, _ reject: @escaping Rejecter) -> (Void) | |
let resolver: Resolver | |
init(_ resolver: @escaping Resolver){ | |
self.resolver = resolver | |
} | |
func then<U>(_ execute: @escaping ((T) -> U)) -> Promise<U> { | |
return Promise<U>({(fulfill, reject) in |
This file contains 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
// | |
// Activity.swift | |
// | |
// Created by Zachary Waldowski on 8/21/16. | |
// Copyright © 2016 Zachary Waldowski. Licensed under MIT. | |
// | |
import os.activity | |
private final class LegacyActivityContext { |
This file contains 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 Accelerate | |
func spectrumForValues(signal: [Double]) -> [Double] { | |
// Find the largest power of two in our samples | |
let log2N = vDSP_Length(log2(Double(signal.count))) | |
let n = 1 << log2N | |
let fftLength = n / 2 | |
// This is expensive; factor it out if you need to call this function a lot | |
let fftsetup = create_fftsetupD(log2N, FFTRadix(kFFTRadix2)) |
This file contains 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
struct InputStreamGenerator : Generator { | |
var inputStream : NSInputStream | |
var chunkSize : Int | |
init(inputStream : NSInputStream, chunkSize : Int) { | |
self.inputStream = inputStream | |
self.chunkSize = chunkSize | |
} | |
This file contains 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
#if DEBUG | |
/** | |
Toggles assertion of Core Data managed object contexts. Only available when DEBUG is defined. | |
When enabled, your application will throw an exception when accessing or modifying entities in a context other than their own. | |
*/ | |
void TCBToggleAssertingContextQueues(); | |
#endif |
NewerOlder