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 Combine | |
import Foundation | |
let wrapper = Wrapper(createPublisher: { Just("foo").eraseToAnyPublisher() }) | |
// This will not produce any auto-complete suggestions | |
wrapper.createPublisher(). | |
struct Wrapper { | |
var createPublisher: () -> AnyPublisher<String, Never> |
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
// Compiles in Xcode 12.5, but not 12.4 | |
var foo: Foo { | |
#if DEBUG | |
Foo(debug: true) | |
#else | |
Foo() | |
#end | |
} | |
// Compiles in both |
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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>WorkingDirectory</key> | |
<string>/Users/teamcity/TeamCity/buildAgent</string> | |
<key>Debug</key> | |
<false/> | |
<key>Label</key> | |
<string>jetbrains.teamcity.BuildAgent</string> |
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
// | |
// AssertEventually.h | |
// LRResty | |
// | |
// Created by Luke Redpath on 03/08/2010. | |
// Copyright 2010 LJR Software Limited. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "HCMatcher.h" |
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
extension Data { | |
// Returns a base64 encoded string, replacing reserved characters | |
// as per https://tools.ietf.org/html/rfc7636#section-4.2 | |
func pkce_base64EncodedString() -> String { | |
base64EncodedString() | |
.replacingOccurrences(of: "+", with: "-") | |
.replacingOccurrences(of: "/", with: "_") | |
.replacingOccurrences(of: "=", with: "") | |
.trimmingCharacters(in: .whitespaces) | |
} |
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
private func hexString(_ iterator: Array<UInt8>.Iterator) -> String { | |
return iterator.map { String(format: "%02x", $0) }.joined() | |
} | |
let exampleVerifier = "kM83K571n5KFW9u29Xu2qSqgoUwep4I2jZw8FGZg4Yr" | |
let verifierData = exampleVerifier.data(using: .utf8)! | |
// CommonCrypto implementation | |
var buffer = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH)) | |
_ = verifierData.withUnsafeBytes { CC_SHA256($0.baseAddress, CC_LONG(verifierData.count), &buffer) } |
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
require 'fileutils' | |
REPORT_FOLDER = Pathname.new('/Users/luke/Documents/Business/Accounts/iTunes Finance Reports') | |
@agent = ITunesConnect::Agent.new | |
@agent.sign_in!('your@email.com', 'yourpassword') | |
begin | |
if @agent.signed_in? | |
@downloaded = 0 |
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
extension RawRepresentable where Self.RawValue == String { | |
/// Parses out the first matching raw value from a list of possible values, or returns nil. | |
/// | |
/// Example: | |
/// | |
/// enum SomeValues: String, CaseIterable { | |
/// case one | |
/// case two | |
/// } | |
/// |
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 TaggedOutput<Output> { | |
let token: AnyHashable | |
let output: Output | |
} | |
struct Effect<Output>: Publisher { | |
typealias Failure = Never | |
let base: AnyPublisher<TaggedOutput<Output>, Failure> | |
let token: AnyHashable |