Skip to content

Instantly share code, notes, and snippets.

View byaruhaf's full-sized avatar
🏄
Surfing Xcode

Franklin Byaruhanga byaruhaf

🏄
Surfing Xcode
View GitHub Profile
@byaruhaf
byaruhaf / py_syslog_dict_config.py
Created April 27, 2025 04:53 — forked from biggers/py_syslog_dict_config.py
Python dictConfig logging example using SyslogHandler - modified from Stackoverflow answer
import logging
import sys
from logging import config
# REF, modified from:
# https://stackoverflow.com/a/19367225
if sys.platform == "darwin":
address = '/var/run/syslog'
facility = 'local1'

Docker Swarm Cheat Sheet

Initialize the local Docker service as a swarm manager. As a guideline, in production you should have 3 to 5 managers. Swarm is managed through port 2377, which should be blocked from external access.

$ docker swarm init

Join an existing swarm as a worker node. Replace $SWARM_MANAGER with the IP address or domain name of a swarm manager node.

@byaruhaf
byaruhaf / .dockerignore
Created February 6, 2025 21:00
node .dockerignore
**/node_modules/
**/dist
.git
npm-debug.log
.coverage
.coverage.*
.env
.aws
@byaruhaf
byaruhaf / .dockerignore
Created February 6, 2025 20:57
python .dockerignore
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
@byaruhaf
byaruhaf / Git Conventional Commits Guide.md
Created January 13, 2025 18:21
Git Conventional Commits Guide

Git Conventional Commits Guide

Basic Commands

Each commit type has a dedicated shortcut command. Here are the basic patterns:

git feat "your message"    # New features
git fix "your message"     # Bug fixes
git docs "your message"    # Documentation changes
@byaruhaf
byaruhaf / PurchaseManager.swift
Created October 30, 2024 11:15 — forked from lienmt/PurchaseManager.swift
PurchaseManager with SwiftUI & StoreKit
import Foundation
import StoreKit
enum ProductsId: String {
case subsWeekly24 = "WeeklyId"
case subsAnnual24 = "AnnualId"
}
@MainActor
class PurchaseManager: NSObject, ObservableObject {
@byaruhaf
byaruhaf / Extension+Logger.swift
Created October 4, 2024 21:07 — forked from bobdel/Extension+Logger.swift
General purpose global logging and signpost configuration file
//
// Extension+Logger.swift
//
// Created by Robert DeLaurentis on 3/13/24.
// Last Modified on 10/4/24.
///**
/// General purpose global logging and signpost configuration
/// file tested on Xcode 16 and iOS 18 with
/// Swift 6 toolchain and strict concurrency
@byaruhaf
byaruhaf / RequestState.kt
Created March 17, 2024 05:32 — forked from stevdza-san/RequestState.kt
Useful wrapper class for handling the data in Jetpack Compose
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.togetherWith
import androidx.compose.runtime.Composable
sealed class RequestState<out T> {
data object Idle : RequestState<Nothing>()
data object Loading : RequestState<Nothing>()
@byaruhaf
byaruhaf / Terminal Output
Created September 30, 2023 20:15
lint collection.json
❯ redocly lint collection.json [23:11:38]
No configurations were provided -- using built in recommended configuration by default.
validating collection.json...
[1] collection.json:1778:9 at #/paths/~1v2_0~1invoice~1{referenceId}
The path already exists which differs only by path parameter name(s): `/v2_0/invoice/{x-referenceId}` and `/v2_0/invoice/{referenceId}`.
1776 | }
1777 | },
struct ContentView: View {
@State private var isPresented = false
var body: some View {
Button("Present!") {
isPresented.toggle()
}
.fullScreenCover(isPresented: $isPresented, content: FullScreenView.init)
}
}