Skip to content

Instantly share code, notes, and snippets.

View RomanPodymov's full-sized avatar
😀
Coding

Roman Podymov RomanPodymov

😀
Coding
View GitHub Profile
@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
}
@chwastek
chwastek / xcframework_create.sh
Last active March 15, 2024 13:10
Reusable script for creating an XCFramework from both Xcode and Terminal. You can run this script with framework's name, if needed (e.g. when running from Terminal).
#!/bin/sh
# -------------- config --------------
# Uncomment for debugging
set -x
# Set bash script to exit immediately if any commands fail
set -e
@AliSoftware
AliSoftware / Bindings.swift
Last active November 4, 2024 10:52
Re-implementation of @binding and @State (from SwiftUI) myself to better understand it
/*:
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI
The only purpose of this code is to implement those wrappers myself
just to understand how they work internally and why they are needed,
⚠️ This is not supposed to be a reference implementation nor cover all
subtleties of the real Binding and State types.
The only purpose of this playground is to show how re-implementing
them myself has helped me understand the whole thing better
@konnnn
konnnn / UILabel+Padding.swift
Last active February 22, 2024 13:24
Swift 4: Adding space/padding to a UILabel Programmatically and Storyboard
/*
If you use Storyboard, don't forget to set UIlabel to PaddingLabel
*/
import UIKit
class PaddingLabel: UILabel {
var topInset: CGFloat
var bottomInset: CGFloat
@kevenbauke
kevenbauke / wkwebview_links_externally.swift
Last active June 21, 2022 17:13
WKWebView open links in Safari
@troyfontaine
troyfontaine / 1-setup.md
Last active November 16, 2024 15:04
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@DejanEnspyra
DejanEnspyra / Obfuscator.swift
Created May 31, 2017 17:51
Obfuscation of hard-coded security-sensitive strings.
//
// Obfuscator.swift
//
// Created by Dejan Atanasov on 2017-05-31.
//
import Foundation
class Obfuscator: AnyObject {
@bhrott
bhrott / osx-disabling-gpg-for-commits.sh
Created February 11, 2017 22:49
OSX: disabling gpg for commits
!#/bin/bash
git config --global commit.gpgsign false
@brennanMKE
brennanMKE / HTTPStatusCodes.swift
Last active June 5, 2023 15:19
Swift Enums for HTTP Status Codes
enum HTTPStatusCodes: Int {
// 100 Informational
case Continue = 100
case SwitchingProtocols
case Processing
// 200 Success
case OK = 200
case Created
case Accepted
case NonAuthoritativeInformation
@khanlou
khanlou / Fonts.swift
Created October 6, 2016 21:10
Print all fonts in Swift 3
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})