Skip to content

Instantly share code, notes, and snippets.

View OksanaFedorchuk's full-sized avatar
🐙
Working hard

Oksana Fedorchuk OksanaFedorchuk

🐙
Working hard
View GitHub Profile
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@bhumphrey
bhumphrey / gist:3764983
Created September 22, 2012 03:10
Cherry-picking from another fork
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
@KyleGoslan
KyleGoslan / UIView+Extension.swift
Last active August 9, 2023 08:47
UIView extension to easily add and remove a blur (UIVisualEffectView)
import UIKit
extension UIView {
func blurView(style: UIBlurEffect.Style) {
var blurEffectView = UIVisualEffectView()
let blurEffect = UIBlurEffect(style: style)
blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = bounds
addSubview(blurEffectView)
}
localeIdentifier Description
eu Basque
hr_BA Croatian (Bosnia & Herzegovina)
en_CM English (Cameroon)
en_BI English (Burundi)
rw_RW Kinyarwanda (Rwanda)
ast Asturian
en_SZ English (Swaziland)
he_IL Hebrew (Israel)
ar Arabic
@Harry-Harrison
Harry-Harrison / ContentView.swift
Last active July 11, 2023 10:42
Haptic Feedback Vibrations in SwiftUI
// This prints a list of buttons that on tap will fire a different type of haptic vibration
import SwiftUI
struct ContentView: View {
let generator = UINotificationFeedbackGenerator()
var body: some View {
VStack(alignment: .center, spacing: 30.0) {
Button(action: {
@rxhanson
rxhanson / gist:df0f2b49f402ea181f5ed61b20f9cd8d
Last active March 28, 2024 13:17 — forked from bhumphrey/gist:3764983
Cherry-picking from another fork
git remote add <other-fork-alias> <other-fork-URL>
git checkout <branch>
git fetch <other-fork-alias>
git cherry-pick <commit-hash>
git push <your-fork-alias>
git remote remove <other-fork-alias>
git remote -v
struct KeychainItem {
// MARK: Nested Types
enum KeychainError: Error {
case noPassword
case unexpectedPasswordData
case unexpectedItemData
case unhandledError(status: OSStatus)
}
{
"rules": {
"users" : {
"$user_id" : {
".read" : "auth != null && $user_id === auth.uid",
".write" : "auth != null && $user_id === auth.uid"
}
}
}
}
@nicholascross
nicholascross / ArrayBuilder.swift
Created June 16, 2021 22:35
Generic array builder using swift 5.4 result builder
@resultBuilder
enum ArrayBuilder<OutputModel> {
static func buildEither(first component: [OutputModel]) -> [OutputModel] {
return component
}
static func buildEither(second component: [OutputModel]) -> [OutputModel] {
return component
}
@protspace
protspace / Swift_5.7_Generics
Last active June 12, 2022 09:43
Design protocol interfaces in Swift
//
// File.swift
// SP
//
// Created by Yevgen Sagidulin on 12.06.2022.
//
import Foundation
protocol AnimalFeed {