-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2440f33
commit 9fc5512
Showing
18 changed files
with
483 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!zsh | ||
|
||
rsync -av --progress --delete --exclude '.DS_Store' --exclude '.Spotlight-V100' --exclude '.Trashes' --exclude '.DocumentRevisions-V100' --exclude '.TemporaryItems' --exclude '.fseventsd' /Volumes/Studio/ /Volumes/Studio\ Backup/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
defaults write com.apple.finder CreateDesktop false | ||
killall Finder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
defaults write com.apple.finder CreateDesktop true | ||
killall Finder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/zsh | ||
|
||
# https://www.ekreative.com/blog/producing-your-own-git-repository-animated-visualization-video/ | ||
# https://github.com/acaudwell/Gource/wiki/Visualizing-Multiple-Repositories | ||
|
||
GOURCE_LOGS=./gourceLogs | ||
mkdir -p ${GOURCE_LOGS} | ||
|
||
REPOS=($@) | ||
|
||
for REPO in "${REPOS[@]}" | ||
do | ||
LOG_FILE=${GOURCE_LOGS}/${REPO}.txt | ||
gource --output-custom-log ${LOG_FILE} ${REPO} | ||
sed -i '' -r "/\.(xc)?framework/d" ${LOG_FILE} | ||
sed -i '' -r "s/Robert McNally/Wolf McNally/" ${LOG_FILE} | ||
sed -i '' -r "s#(.+)\|#\1|/${REPO}#" ${LOG_FILE} | ||
done | ||
|
||
COMBINED_LOG=${GOURCE_LOGS}/combined.txt | ||
|
||
cat ${GOURCE_LOGS}/${^REPOS}.txt | sort -n > ${COMBINED_LOG} | ||
|
||
gource --frameless --multi-sampling --hide root,bloom --filename-time 2 --bloom-multiplier 0.5 --bloom-intensity 0.5 --elasticity 0.001 --viewport 1920x1080 --highlight-users --highlight-colour aaffaa --user-scale 1.5 --max-user-speed 200 --user-friction 0.5 --highlight-dirs --dir-name-depth 1 --dir-colour aaaaff --seconds-per-day 0.1 --auto-skip-seconds 0.1 ${GOURCE_LOGS}/combined.txt | ||
|
||
# --disable-auto-rotate | ||
# --fixed-user-size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/zsh | ||
|
||
ssh -i "~/.ssh/arciem-keypair.pem" [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/zsh | ||
|
||
aws ec2 start-instances --instance-ids i-03db5ae1335fc09b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/zsh | ||
|
||
aws ec2 stop-instances --instance-ids i-03db5ae1335fc09b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!python3 | ||
|
||
import os | ||
import sys | ||
import time | ||
import re | ||
from watchdog.observers import Observer | ||
from watchdog.events import FileSystemEventHandler | ||
|
||
# Mapping of file extensions to Markdown code syntax specifiers | ||
syntax_highlighting = { | ||
'.swift': 'swift', | ||
'.py': 'python', | ||
'.js': 'javascript', | ||
'.ts': 'typescript', | ||
} | ||
|
||
# List of regexes for prioritizing specific files | ||
priority_files = [r"STARTHERE"] | ||
|
||
# List of regexes for omitting specific files | ||
omit_files = [r".*\.(png|jpg|jpeg|gif|svg)"] | ||
|
||
class ChangeHandler(FileSystemEventHandler): | ||
def __init__(self, directory, output_file, process_func): | ||
self.directory = directory | ||
self.output_file = output_file | ||
self.process_func = process_func | ||
|
||
def on_any_event(self, event): | ||
# Ignoring changes to the output file itself | ||
if self.output_file and os.path.abspath(event.src_path) == os.path.abspath(self.output_file): | ||
return | ||
self.process_func(self.directory, self.output_file) | ||
|
||
def list_files_and_contents(directory, output_file=None): | ||
top_level_directory = os.path.basename(directory.rstrip(os.sep)) | ||
all_paths = [] | ||
priority_paths = [] | ||
omitted_paths = [] | ||
for root, dirs, files in os.walk(directory, topdown=True): | ||
# Remove directories that start with '.' | ||
dirs[:] = [d for d in dirs if not d.startswith('.')] | ||
files = [f for f in files if not f.startswith('.')] | ||
for filename in files: | ||
full_path = os.path.join(root, filename) | ||
if any(re.search(pattern, filename) for pattern in priority_files): | ||
priority_paths.append(full_path) | ||
elif any(re.search(pattern, filename) for pattern in omit_files): | ||
omitted_paths.append(full_path) | ||
else: | ||
all_paths.append(full_path) | ||
|
||
# Prioritize certain files by moving them to the front | ||
all_paths = priority_paths + all_paths | ||
all_paths.sort(key=lambda x: (x not in priority_paths, x)) | ||
|
||
output_lines = [f"# {top_level_directory}\n\n"] | ||
for path in all_paths + omitted_paths: | ||
relative_path = os.path.relpath(path, directory) | ||
file_extension = os.path.splitext(path)[1] | ||
syntax_specifier = syntax_highlighting.get(file_extension, '') | ||
if path in omitted_paths: | ||
output_lines.append(f"## {relative_path}\n\n*OMITTED*\n\n") | ||
else: | ||
output_lines.append(f"## {relative_path}\n\n```{syntax_specifier}\n") | ||
try: | ||
with open(path, 'r') as file: | ||
content = file.read() | ||
if content.endswith('\n'): | ||
output_lines.append(content.rstrip('\n') + '\n```\n\n') | ||
else: | ||
output_lines.append(content + '\n```\n\n') | ||
except Exception as e: | ||
output_lines.append(f"Error reading file {relative_path}: {e}\n```\n\n") | ||
|
||
if output_file: | ||
with open(output_file, 'w') as f: | ||
f.writelines(output_lines) | ||
else: | ||
print(''.join(output_lines)) | ||
|
||
def main(): | ||
output_file = None | ||
watch = False | ||
|
||
try: | ||
directory = sys.argv[1] | ||
if '-o' in sys.argv: | ||
o_index = sys.argv.index('-o') | ||
output_file = sys.argv[o_index + 1] | ||
if '-w' in sys.argv: | ||
watch = True | ||
except (IndexError, ValueError): | ||
print("Usage: script.py <directory_path> [-o output_file_path] [-w]") | ||
sys.exit(1) | ||
|
||
list_files_and_contents(directory, output_file) | ||
|
||
if watch: | ||
event_handler = ChangeHandler(directory, output_file, list_files_and_contents) | ||
observer = Observer() | ||
observer.schedule(event_handler, directory, recursive=True) | ||
observer.start() | ||
try: | ||
while True: | ||
time.sleep(1) | ||
except KeyboardInterrupt: | ||
observer.stop() | ||
observer.join() | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
BASENAME=${1%%.*} | ||
TEMPNAME=${BASENAME}.tmp | ||
OUTPUTNAME=${BASENAME}.txt | ||
|
||
echo "<html><head><style>body { font-size: 36pt; font-family:sans-serif; }</style></head><body>" > ${TEMPNAME} | ||
markdown "${1}" >> ${TEMPNAME} | ||
echo "</body></html>" >> ${TEMPNAME} | ||
|
||
textutil "${TEMPNAME}" -inputencoding UTF-8 -format html -convert txt -output "${OUTPUTNAME}" | ||
|
||
rm "${TEMPNAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# Based on: https://paulz.github.io/xcode/source/code/2015/12/12/remove-default-header-comment-in-xcode.html | ||
|
||
XCODE="Xcode-beta" | ||
XCODE_DEV="/Applications/${XCODE}.app/Contents/Developer" | ||
pushd "${XCODE_DEV}/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates" | ||
find -E . -type f \ | ||
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \ | ||
-exec sed -i '' '1,/^$/d' '{}' ';' | ||
popd | ||
|
||
pushd "${XCODE_DEV}/Library/Xcode/Templates" | ||
find -E . -type f \ | ||
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \ | ||
-exec sed -i '' '1,/^$/d' '{}' ';' | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
git rev-parse --short HEAD |
Oops, something went wrong.