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
# Likely needs some tweaks to the `ssh $ip` line to account for key, user, etc. | |
sshinstance() { | |
ip=`aws ec2 describe-instances \ | |
--output text \ | |
--instance-id $1 \ | |
--query 'Reservations[*].Instances[*].{Instance:PrivateIpAddress}' \ | |
| tr -d '\r' \ | |
| tr -d '\n'` | |
ssh $ip |
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
pr() { | |
branch=`git rev-parse --abbrev-ref HEAD` | |
github_url=`git remote get-url origin | sed 's/....$//'` | |
open $github_url/compare/$branch?expand=1 | |
} |
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/bash | |
# Outputs commands to delete local branches that have an | |
# associated merged (really closed) PR. | |
# BIG CAVEAT: This will report branches that have a closed, | |
# but not merged PR for deletion. | |
# Your Github username and the name of the organization you are a part of | |
# If you are using forks, or aren't part of an org. then your GITHUB_ORG |
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
dir_loc=`getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db | |
count=`sqlite3 $dir_loc/db 'select count(*) from presented_notifications'` | |
echo $count | |
if [ $count -ne 0 ]; then | |
/bin/echo -n "green" | nc -4u -w0 localhost 1739 | |
else | |
/bin/echo -n "white" | nc -4u -w0 localhost 1739 | |
fi |