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 | |
import Combine | |
struct A { | |
let name: String | |
} | |
struct B { | |
let text: 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
# Place it in .github/workflows/languages.yml | |
name: Repositoy Languages | |
on: | |
push: | |
branches: | |
- master | |
jobs: |
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
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, macCatalyst 13.0, *) | |
// MARK: - Request | |
protocol Request { | |
associatedtype Response: Decodable | |
var urlRequest: URLRequest { get } | |
} | |
// MARK: - APISession |
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 | |
/* | |
This works fine. | |
*/ | |
struct NonCrashView: View { | |
@State private var isPopup: Bool = false | |
var body: some View { | |
Button("Foo") { |
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 PlaygroundSupport | |
public struct DebuggerView<Body: View>: View { | |
private let _body: Body | |
private let color: Color | |
public init(body: Body, color: Color? = nil) { | |
self._body = body |
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 Foundation | |
var value: Any = "value" | |
@propertyWrapper | |
struct Wrapper<Value> { | |
private let defaultValue: Value | |
init(defaultValue: Value) { | |
self.defaultValue = defaultValue |
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 Foundation | |
@propertyWrapper | |
struct UserDefault<Value> { | |
private let key: String | |
private let defaultValue: Value | |
private let defaults: UserDefaults | |
init(key: String, defaultValue: Value, defaults: UserDefaults = .standard) { | |
self.key = key |
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 Foundation | |
import Combine | |
protocol Request { | |
associatedtype Response: Decodable | |
var resource: Data { get } | |
} | |
struct User: Decodable { | |
let name: 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
extension UIColor { | |
convenience init(hex string: String, alpha: CGFloat) { | |
let hex = string.replacingOccurrences(of: "#", with: "") | |
let scanner = Scanner(string: hex) | |
var color: UInt32 = 0 | |
if scanner.scanHexInt32(&color) { | |
let r = CGFloat((color & 0xFF0000) >> 16) / 255.0 | |
let g = CGFloat((color & 0x00FF00) >> 8) / 255.0 | |
let b = CGFloat(color & 0x0000FF) / 255.0 | |
self.init(red: r, green: g, blue: b, alpha: alpha) |
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
~/.config/fish/functions/studio.fish | |
function studio -d "Open file by Android Studio" | |
set -l file $argv[1] | |
set -l a_option $argv[2] | |
set -l application $argv[3] | |
if test -z $a_option | |
set a_option -a | |
set application 'Android Studio' |
NewerOlder