Skip to content

Instantly share code, notes, and snippets.

View PWrzesinski's full-sized avatar

Przemysław Wrzesiński PWrzesinski

View GitHub Profile
@geor-kasapidi
geor-kasapidi / SKError.swift
Created July 20, 2021 17:02
SKError codes
@available(iOS 3.0, *)
public enum Code : Int {
public typealias _ErrorType = SKError
case unknown = 0
case clientInvalid = 1 // client is not allowed to issue the request, etc.
case paymentCancelled = 2 // user cancelled the request, etc.
@KoCMoHaBTa
KoCMoHaBTa / - UITesting Utilities.md
Last active July 13, 2022 00:22
UITesting Utilities

UITesing Utilities

Contents

How to use

  • add the contents to your UITesting target
  • import XCTest-Private.h into your UITesting target bridging header
  • in your XCTestCase tearDown() method use the Springboard utility to delete the app and/or reset Location and Privacy Settings
@emaloney
emaloney / guard-closure.md
Last active August 1, 2023 00:24
A simplified notation for avoiding the weak/strong dance with closure capture lists

Simplified notation for avoiding the [weak self]/strongSelf dance with closures

  • Proposal: TBD
  • Author: Evan Maloney
  • Status: Draft
  • Review manager: TBD

Introduction

Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:

@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'