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
git branch -D `git branch | grep <prefix>` |
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
defaults write com.apple.TextEdit "TabWidth" '2' |
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
docker compose exec database pg_dump -U <user> -W <datbase> > database.sql | |
docker compose exec -T database psql -U <user> <database> < database.sql |
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
$('.some-class').on('click', function(e){ | |
e.preventDefault(); | |
$.getScript($(this).attr('href')); | |
}); |
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
require 'octokit' | |
def gh_stats(org, author) | |
repos = repos(org, 'private') | |
repos += repos(org, 'public') | |
total_additions = 0 | |
total_deletions = 0 | |
total_commits = 0 |
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
xcode-select --install |
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
find . -name *_foo.rb -exec rename 's/(.*)_foo.rb/\1_bar.rb/g' *.rb {} \; |
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
aws s3 cp s3://path/to/bucket . --recursive |
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
# 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 |
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
#!/bin/sh | |
# pushes the current branch to git hub and opens your browser to the | |
# pull request page for the current branch | |
OUTPUT=`(git push origin HEAD) 2>&1` | |
URL=`echo $OUTPUT | sed -e 's/.*visiting: remote: \(https:\/\/github.com[A-Za-z0-9%\/_-]*\).*/\1/'` | |
echo opening $URL | |
open $URL |
NewerOlder