Skip to content

Instantly share code, notes, and snippets.

View dougboutwell's full-sized avatar

Doug Boutwell dougboutwell

View GitHub Profile
@dougboutwell
dougboutwell / build-viewinspector-xcframework.sh
Created September 22, 2022 21:54
Shell script to build a .xcframework from the ViewInspector library for SwiftUI
#!/bin/bash
# Script for building a .xcframework, specifically for ViewInspector
#
# ViewInspector GitHub:
# - https://github.com/nalexn/ViewInspector
#
# Apple's docs:
# - https://help.apple.com/xcode/mac/11.4/#/dev544efab96
#
@dougboutwell
dougboutwell / gist:20dd568abef0b27e8aaae23178ac90d5
Created August 23, 2022 17:42
Silence iOS simulator "CoreTelephony" error messages in log
In Terminal:
xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony
Credit to https://stackoverflow.com/a/53708751/3953735
@dougboutwell
dougboutwell / xa.py
Created December 7, 2021 22:06
Extract audio from typical YouTube video files with ffmpeg
#!/usr/bin/python
import os
import sys
import subprocess
import argparse
parser = argparse.ArgumentParser(description="Extract audio from video files")
parser.add_argument("files", metavar="file", nargs="+")
parser.add_argument("-w", "--wav", dest="codec", action="store_const", const="pcm_s16le", default="copy")
@dougboutwell
dougboutwell / join_gopro_files.py
Last active December 6, 2021 16:08
Join 4GB GoPro chapter video files into a single file with ffmpeg
# Script to join GoPro video files, which are split at 4GB boundaries, into a single file
import os
import glob
import subprocess
# sleazy case-insensitive list of mp4 files in this dir
filepaths = glob.iglob("*.[mM][pP]4")
filenames = list(filter(lambda f: os.path.split(f)[1], filepaths))
# extract unique clip numbers from list of all files in this dir