View utf8bom
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
#!/usr/bin/env bash | |
if [ $# -ne 2 ] && [ $# -ne 1 ]; then | |
echo "use: $0 source <destination>" | |
exit | |
fi | |
if [ ! -f $1 ]; then | |
printf "\e[31m$1\e[0m does not seem to be a file" |
View svn2ftp.sh
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
#!/usr/bin/env bash | |
#set temp dir (from second arguments). defaults to __toupload | |
dest=${2:-__toupload} | |
dest=${dest%/}/ | |
to=$(svn info --show-item revision) | |
# get start revision from first argument (default to -1) | |
from=${1:--1} |
View git2ftp.sh
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
#!/usr/bin/env bash | |
#set temp dir (from second arguments). defaults to __toupload | |
dest=${2:-__toupload} | |
dest=${dest%/}/ | |
to="HEAD" | |
# get start revision from first argument (default to -1) | |
from=${1:-1} |
View whatismyip.sh
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
#!/usr/bin/env bash | |
curl -s ip-api.com/json | python -m json.tool |
View shrink.js
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const path = require('path'); | |
function error(message) { | |
console.error(message); | |
process.exit(); | |
} |
View git-ch
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
#!/usr/bin/env bash | |
get_branches="git branch | sort -u" | |
if [[ $# -eq 0 ]] ; then | |
eval "$get_branches | nl -ba" | |
exit; | |
fi | |
branch_num=$1 |
View phpversion.sh
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
# Add this function to your ~/.bash_profile file | |
# To show current linked version, run: `phpversion` | |
# To link another version, run: `phpversion VERSION` (e.g. `phpversion 7.2`) | |
phpversion() { | |
# Get currently installed HomeBrew php version (ignoring system php) | |
local current_php_version=$(/usr/local/bin/php -r "echo PHP_VERSION;" 2>/dev/null | awk -F'.' '{print "php@" $1 "." $2}') | |
# If no argument passed - Present the current version | |
if [ -z "$1" ]; then |
View sshhosts.sh
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
#!/usr/bin/env bash | |
get_hosts="cat ~/.ssh/config | grep Host\\\\s | awk '{ print \$2 }' | sort -u" | |
if [[ $# -eq 0 ]] ; then | |
eval "$get_hosts | nl -ba" | |
exit; | |
fi | |
host_num=$1 |