Skip to content

Instantly share code, notes, and snippets.

View a-voronov's full-sized avatar
👽
Curious

Oleksandr Voronov a-voronov

👽
Curious
View GitHub Profile
@a-voronov
a-voronov / AnyLoadingStatus.swift
Last active August 31, 2020 11:08
Loading Status FSM 🚥
/// Represents loading status, consisting of multiple steps.
/// All values' types can be specified depending on the problem.
enum AnyLoadingStatus<Loading, Loaded, Failed, Error: Swift.Error> {
case idle
case loading(Loading)
case loaded(Loaded)
case failed(Failed, Error)
}
extension AnyLoadingStatus {
@a-voronov
a-voronov / Maybe.swift
Created September 5, 2020 23:44
Optional built with Struct 🤪
/// Example of using static functions and properties to construct an instance of a type
/// for a struct, similar to how enum uses its cases.
/// Let's call it Maybe.
struct Maybe<Wrapped> {
private(set) var value: Wrapped!
var hasValue: Bool {
value != nil
}
@a-voronov
a-voronov / requirements-x86_64.txt
Last active August 27, 2021 22:14
OpenCV Courses - Jupyter + Python + dlib on Big Sur M1 x86_64
appnope==0.1.2
argon2-cffi==20.1.0
attrs==21.2.0
backcall==0.2.0
bleach==4.0.0
cffi==1.14.6
cycler==0.10.0
debugpy==1.4.1
decorator==5.0.9
defusedxml==0.7.1
@a-voronov
a-voronov / requirements-arm64.txt
Last active August 22, 2021 02:33
OpenCV Courses - Jupyter + Python on Big Sur M1 arm64
appnope==0.1.2
argon2-cffi==20.1.0
attrs==21.2.0
backcall==0.2.0
bleach==4.0.0
certifi==2021.5.30
cffi==1.14.6
cycler==0.10.0
debugpy==1.4.1
decorator==4.4.2
@a-voronov
a-voronov / .remap
Created February 7, 2024 11:00
remap Finnish keyboard to US layout
sudo hidutil property --set '{ "UserKeyMapping": [ { "HIDKeyboardModifierMappingSrc": 0x700000064, "HIDKeyboardModifierMappingDst": 0x700000035 }, { "HIDKeyboardModifierMappingSrc": 0x700000035, "HIDKeyboardModifierMappingDst": 0x7000000E1 } ] }'
@a-voronov
a-voronov / .fileMergeFix
Last active April 15, 2024 10:15
Fixing Xcode FileMerge spamming in terminal when merging swift files
cp /Applications/Xcode.app/Contents/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications/Swift.xclangspec /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/Swift.xclangspec