Skip to content

Instantly share code, notes, and snippets.

View leogdion's full-sized avatar

leogdion leogdion

View GitHub Profile
@leogdion
leogdion / age-rating-implementation.md
Created December 11, 2025 20:30
Age Rating Configuration Implementation for Bitness

Age Rating Configuration Implementation

Overview

Added age rating configuration to fastlane setup, enabling automated updates of App Store age rating metadata without requiring binary uploads.

Changes Made

1. Age Rating Configuration File

@leogdion
leogdion / clean_beta_runtimes.sh
Last active July 23, 2025 13:21
Delete Old 26.0 Beta Simulator Runtime
#!/bin/bash
# Script to clean up old 26.0 beta simulator runtimes
# Keeps only the latest build version for each platform
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
@leogdion
leogdion / Dockerfile
Created June 16, 2025 21:03
Dockerfile for xtool
# Use Ubuntu 24.04 as the base image
FROM ubuntu:24.04
# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Add to /etc/fstab to make permanent
echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
sudo yum update -y && sudo yum install docker -y && sudo yum install git -y && sudo yum install libicu -y &&
sudo systemctl start docker
sudo systemctl enable docker
@leogdion
leogdion / split_swift.sh
Created July 23, 2024 19:43
Split Swift File by Brackets
#!/bin/bash
# Check if a filename was provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <filename>"
exit 1
fi
filename=$1
@leogdion
leogdion / Database.swift
Last active July 22, 2024 12:57
Sample Code for ModelActor
public protocol Database: Sendable {
func delete<T: PersistentModel>(
where predicate: Predicate<T>?
) async throws
func insert(_ closuer: @Sendable @escaping () -> some PersistentModel) async
func fetch<T, U : Sendable>(
_ selectDescriptor: @escaping @Sendable () -> FetchDescriptor<T>,
with closure: @escaping @Sendable ([T]) throws -> U
@leogdion
leogdion / XcodeApplication.swift
Last active July 16, 2024 18:37
Xcode Script Bridging
import AppKit
import ScriptingBridge
@objc public protocol SBObjectProtocol: NSObjectProtocol {
func get() -> Any!
}
@objc public protocol SBApplicationProtocol: SBObjectProtocol {
func activate()
#!/bin/bash
# Define Swift Package Dependencies
dependencies=(
"Vapor:https://github.com/vapor/vapor.git:4.66.0"
"Fluent:https://github.com/vapor/fluent.git:4.0.0"
"FluentPostgresDriver:https://github.com/vapor/fluent-postgres-driver.git:2.0.0"
"JWT:https://github.com/vapor/jwt.git:5.0.0-beta.1"
"AsyncAlgorithms:https://github.com/apple/swift-async-algorithms:1.0.0"
"OpenAPIVapor:https://github.com/swift-server/swift-openapi-vapor:1.0.0"
#!/bin/bash
# Check if input file is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <input_file.swift>"
exit 1
fi
input_file="$1"
output_file="${input_file%.swift}_cleaned.swift"