Skip to content

Instantly share code, notes, and snippets.

View chrsp's full-sized avatar

Charles Prado chrsp

  • Post Finance
  • Portugal
View GitHub Profile
@chrsp
chrsp / add_files.sh
Created September 8, 2023 09:04
Uses xcodeproj to add from a folder to a Xcode Project
#!/bin/bash
# Function to install the 'xcodeproj' gem
install_xcodeproj() {
gem install xcodeproj
}
# Check if 'xcodeproj' gem is installed
if ! gem spec xcodeproj > /dev/null 2>&1; then
echo "Installing 'xcodeproj' gem..."
@chrsp
chrsp / remove_duplicate_imports.py
Last active September 21, 2023 11:49
Use to remove duplicate imports in Swift Files
import os
import re
import sys
def find_swift_files(directory):
swift_files = []
for root, _, files in os.walk(directory):
for file in files:
if file.endswith(".swift"):
swift_files.append(os.path.join(root, file))
@chrsp
chrsp / changed_files_by_author.sh
Last active January 12, 2024 15:20
Returns all the files updated by the provided authors in the interval of a month
#!/bin/bash
#This Bash script generates a succinct summary of file changes in Git repositories for specified users over the last month. The script accepts a list of Git usernames, producing a Markdown file (`changed_files.md`) that lists unique changed files for each user, limited to commits made within the past month. To ensure a fresh summary is created with each execution, the script clears the previous content of the output file.
#1. Edit the `git_users` array with the desired Git usernames and emails.
#2. Save the script and make it executable.
#3. Run the script to obtain an updated changes summary in the Markdown file.
# List of git users
git_users=(
"user1"