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 enum NetworkingError: Error { | |
case unknown | |
case unexpectedStatus(HTTPURLResponse) | |
} | |
extension URLSession { | |
func load(_ url: URL, | |
completionHandler: @escaping (Result<Data, Error>) -> Void) | |
-> URLSessionDataTask { | |
let task = dataTask(with: url) { data, response, error 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
import UIKit | |
struct AsyncAPI { | |
enum AsyncAPIError: Error, LocalizedError { | |
case callDidNotCompleteSynchronously | |
case noErrorAndNoData | |
var errorDescription: String? { | |
switch self { |
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
// Authoer: The SwiftUI Lab | |
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/ | |
import SwiftUI | |
struct RefreshableScrollView<Content: View>: View { | |
@State private var previousScrollOffset: CGFloat = 0 | |
@State private var scrollOffset: CGFloat = 0 | |
@State private var frozen: Bool = false | |
@State private var rotation: Angle = .degrees(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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
Adjusts the time tracking for issues in a given JIRA project. | |
Requires 'jira' library: | |
$ pip install jira | |
JIRA credentials need to be stored in a file '.jira_auth.json'. | |
Its contents should be: |
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
git config --global http.proxy http://myproxyserver:8080 |