Skip to content

Instantly share code, notes, and snippets.

View jshier's full-sized avatar

Jon Shier jshier

  • Detroit Labs
  • Rochester Hills, MI
View GitHub Profile
@jshier
jshier / gist:06d85f24508a36db08e3be4acf79b26a
Created April 16, 2024 15:13
TCAUIKit Duplicate dismiss Backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #0: 0x0000000104fae5f0 TCAUIKit`closure #1 in AppFeature.body.getter(state=TCAUIKit.AppFeature.State @ 0x000000016ae59040, action=modal) at AppFeature.swift:40:25
frame #1: 0x0000000105062ad4 TCAUIKit`Reduce.reduce(state=TCAUIKit.AppFeature.State @ 0x000000016ae59040, action=modal, self=(reduce = 0x0000000104fae490 TCAUIKit`closure #1 (inout TCAUIKit.AppFeature.State, TCAUIKit.AppFeature.Action) -> ComposableArchitecture.Effect<TCAUIKit.AppFeature.Action> in TCAUIKit.AppFeature.body.getter : some at AppFeature.swift:35)) at Reduce.swift:35:10
frame #2: 0x0000000105062b0c TCAUIKit`protocol witness for Reducer.reduce(into:action:) in conformance Reduce<τ_0_0, τ_0_1> at <compiler-generated>:0
frame #3: 0x000000010505be70 TCAUIKit`_PresentationReducer.reduce(state=TCAUIKit.AppFeature.State @ 0x000000016ae59040, action=modal, self=ComposableArchitecture._PresentationReducer<ComposableArchitecture.Reduce<TCAUIKit.AppFea
+__rvm_make:0> make -j10
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -std=gnu99 -I/opt/homebrew/Cellar/capstone/4.0.2/include/capstone -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidd
@jshier
jshier / AlamofireSanitizerIssues.txt
Created November 5, 2021 02:13
Alamofire Test Thread Sanitizer Issues
Test Suite 'Selected tests' started at 2021-11-04 21:46:22.999
Test Suite 'Alamofire macOS Tests.xctest' started at 2021-11-04 21:46:23.001
Test Suite 'DataConcurrencyTests' started at 2021-11-04 21:46:23.002
Test Case '-[Alamofire_macOS_Tests.DataConcurrencyTests testThatDataTaskCancellationCancelsRequest]' started.
==================
WARNING: ThreadSanitizer: data race (pid=66170)
Read of size 8 at 0x7b60000307a0 by thread T4:
#0 (1) await resume partial function for closure #2 in closure #1 in DataRequest.dataTask<A>(automaticallyCancelling:forResponse:) Concurrency.swift:191 (Alamofire:x86_64+0x73e01)
#1 swift::runJobInEstablishedExecutorContext(swift::Job*) <null>:2 (libswift_Concurrency.dylib:x86_64+0x2db4d)
@jshier
jshier / rvm make -j8 output
Created July 28, 2020 20:17
rvm make -j8 output
+__rvm_make:0> make -j8
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -std=gnu99 -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin20 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_S
@jshier
jshier / rvm install ruby-2.7.1 --debug
Created July 28, 2020 20:15
rvm install ruby-2.7.1 --debug
jshier@DTK ~ % rvm install ruby-2.7.1 --debug
ruby-2.7.1 - install
ruby-2.7.1 - #already removed src/ruby-2.7.1
ruby-2.7.1 - #already removed rubies/ruby-2.7.1
Searching for binary rubies, this might take some time.
Running(16): curl --fail --location --max-redirs 10 --max-time 1800 --silent --insecure --location --list-only --max-time 5 --head https://rvm_io.global.ssl.fastly.net/binaries/osx/11.0/arm64/ruby-2.7.1.tar.bz2 --insecure
Remote file does not exist https://rvm_io.global.ssl.fastly.net/binaries/osx/11.0/arm64/ruby-2.7.1.tar.bz2
Running(16): curl --fail --location --max-redirs 10 --max-time 1800 --silent --insecure --location --list-only --max-time 5 --head https://repo1.maven.org/maven2/org/jruby/jruby-dist/ruby-2.7.1.tar.bz2 --insecure
Remote file does not exist https://repo1.maven.org/maven2/org/jruby/jruby-dist/ruby-2.7.1.tar.bz2
Travis binaries for OSX are not movable and can't be used outside of Travis environment. Skip that source.
@jshier
jshier / CloudFlareResponseSerializer.swift
Created January 30, 2017 04:03
Custom Alamofire 4 ResponseSerializer
struct CloudFlareResponseSerializer<T: Decodable>: DataResponseSerializerProtocol where T == T.DecodedType {
var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<T> = { (request, response, data, error) in
guard error == nil else { return .failure(CloudFlareError.network(error: error!)) }
let jsonSerializationResult = DataRequest.jsonResponseSerializer().serializeResponse(request, response, data, nil)
guard case let .success(responseJSON) = jsonSerializationResult else {
return .failure(CloudFlareError.serialization(error: jsonSerializationResult.error!))
}
@jshier
jshier / StatefulViewController.swift
Last active April 10, 2017 03:39
A stateful view controller
//
// ViewController.swift
// ArchitectureTest
//
// Created by Jon Shier on 6/11/16.
// Copyright © 2016 Jon Shier. All rights reserved.
//
import Alamofire
import Argo
extension SequenceType {
@warn_unused_result
func firstElement(@noescape predicate: (Self.Generator.Element) throws -> Bool) rethrows -> Self.Generator.Element? {
for element in self {
if try predicate(element) {
return element
}
}
@jshier
jshier / ResponseSerializer.swift
Last active February 12, 2017 23:06
Custom ResponseSerializer for Alamofire 3
static func CloudFlareResponseSerializer<T: Decodable where T == T.DecodedType>() -> ResponseSerializer<T, CloudFlareError> {
return ResponseSerializer { (request, response, data, error) in
guard error == nil else {
return .Failure(CloudFlareError.NetworkError(error: error!))
}
let JSONResult = Request.JSONResponseSerializer().serializeResponse(request, response, data, nil)
guard case let .Success(responseJSON) = JSONResult else {
return .Failure(CloudFlareError.SerializationError(error: JSONResult.error!))
}
@jshier
jshier / gist:b4858a4b417217fe8c73
Last active June 21, 2017 12:53
Generic Alamofire response serializer with Argo and a custom error type
static func CloudFlareResponseSerializer<T: Decodable where T == T.DecodedType>() -> GenericResponseSerializer<T> {
return GenericResponseSerializer { (request, response, data) -> Result<T> in
guard let validData = data else {
let failureReason = "Tried to decode response with nil data."
let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason)
return .Failure(data, CloudFlareError.SerializationError(error: error))
}
let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments)
let JSONResult = JSONSerializer.serializeResponse(request, response, validData)