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

Lesson 4.3 - Re-record 2 (03:21 - End)

Video to re-record: Lesson 4.3

--- [START RE-RECORD 03:21 - End] ---

03:21 (Voiceover showcasing dark mode changes and using the device picker) "Franklin here. When you go back to Content View, make sure you're looking at that second preview. And if it's not showing up right, press Command-Option-P to refresh.

Lesson 4.3 - Re-record 1 (01:10 - 02:31)

Video to re-record: Lesson 4.3

--- [START RE-RECORD 01:10 - 02:31] ---

01:10 (Voiceover explaining implicit stacking) "Franklin here. Let's create two different preview macros—one for light mode and one for dark mode."

Lesson 4.28 - Re-record 2 (06:08 - 08:24)

Video to re-record: Lesson 4.28

--- [START RE-RECORD 06:08 - 08:24] ---

06:08 (Voiceover addressing the preview errors and explaining the @Previewable fix) "Franklin here. Immediately, you're going to get some errors inside your previews. This happens because, by adding these properties to PointsView, you now need to pass in those values when creating an instance of it inside the preview macro. Because PointsView requires bindings to state variables to function correctly, you can fix these errors by using the new @Previewable macro right before your @State properties. This allows your state variables to function perfectly inside the preview block."

Lesson 4.28 - Re-record 1 (04:10 - 04:48)

Video to re-record: Lesson 4.28

--- [START RE-RECORD 04:10 - 04:48] ---

04:10 (Voiceover explaining landscape orientation in previews) "Franklin here. Preview Traits are a powerful way to configure the Xcode preview environment. While you could use the Device Settings button on the canvas to change the orientation, that applies globally to every preview. By adding a trait directly to the macro, you can configure just this specific preview to render in landscape."

@byaruhaf
byaruhaf / increase-build-number.sh
Created June 7, 2026 21:07 — forked from janten/increase-build-number.sh
Bash script for Xcode. Updates build number automatically and saves some useful information (e.g. current git commit) about the build environment to Info.plist.
#!/bin/bash
# increase-build-number.sh
# @desc Auto-increment the build number every time the project is run and add build information to plist
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"

Starting a new Python project

Create a new project:

uv init my-ai-app
cd my-ai-app

Project structure:

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This repository contains an Xcode project written with Swift and SwiftUI. Please follow the guidelines below so that the development experience is built on modern, safe API usage.

Role

You are a Senior iOS Engineer, specializing in SwiftUI, SwiftData, and related frameworks. Your code must always adhere to Apple's Human Interface Guidelines and App Review guidelines.

@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