Skip to content

Instantly share code, notes, and snippets.

View doyle's full-sized avatar

Christian Doyle doyle

View GitHub Profile
@doyle
doyle / gist:6cfbfa63615189bd824882f2ba20b407
Created August 6, 2026 17:26
Convert m4a to Gong compatible mp3
ffmpeg -i input.m4a -codec:a libmp3lame -b:a 128k -ar 44100 -ac 2 output.mp3
@doyle
doyle / rm_branch_by_prefix.sh
Created February 14, 2025 14:31
Delete all git branches matching a prefix
git branch -D `git branch | grep <prefix>`
@doyle
doyle / soft_tabs.sh
Created May 23, 2024 18:01
Enable soft tabs in TextEdit
defaults write com.apple.TextEdit "TabWidth" '2'
@doyle
doyle / docker_psql.sh
Created April 2, 2024 17:46
Dump and load a postgres database in a docker container
docker compose exec database pg_dump -U <user> -W <datbase> > database.sql
docker compose exec -T database psql -U <user> <database> < database.sql
@doyle
doyle / remote.js
Created March 6, 2023 14:36
Simulates the remote: true behavior in rails's links
$('.some-class').on('click', function(e){
e.preventDefault();
$.getScript($(this).attr('href'));
});
@doyle
doyle / gh_stats.rb
Last active December 1, 2022 16:50
Pulls a list of an author's contributions to a GitHub organization
require 'octokit'
def gh_stats(org, author)
repos = repos(org, 'private')
repos += repos(org, 'public')
total_additions = 0
total_deletions = 0
total_commits = 0
@doyle
doyle / install_xcode_command_line_tools.sh
Created June 9, 2022 13:53
Always run this after updating OSX
xcode-select --install
@doyle
doyle / rename_files_recursive.sh
Last active March 3, 2022 20:47
Recursively rename many files in a directory
find . -name *_foo.rb -exec rename 's/(.*)_foo.rb/\1_bar.rb/g' *.rb {} \;
@doyle
doyle / s3_sync.sh
Last active September 20, 2022 15:01
Example of copying files from s3 to local
aws s3 cp s3://path/to/bucket . --recursive
# decrypts messages in the Futurama AL2 language: https://theinfosphere.org/Alien_languages
encrypted_message = %w(19 0 4 21 25 17 4 18 10 4 6 13 6 13 21 8 14 14 6 25 21 9).map(&:to_i)
decrypted_message = ''
encrypted_message.each_with_index do |value, index|
if index > 0
value = value - encrypted_message[index - 1]
value = value >= 0 ? value : 26 + value
end