This file contains hidden or 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
alias hiddenshow='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' | |
alias hiddenhide='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' |
This file contains hidden or 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
return_value() | |
{ | |
local _variable_="${!1}" | |
local _other_="other value" | |
# Make a default value if the variable passed was empty | |
if [ -z "$_variable_" ]; then | |
_variable_="default" | |
fi |
This file contains hidden or 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
check_error() | |
{ | |
# Check for an error | |
if [ "${1}" -ne "0" ]; then | |
# Check for a custom message | |
if [ ! -z "${2}" ]; then | |
echo "${2}" | |
else | |
echo "Fatal error" |
This file contains hidden or 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
# Return the proper error code if a pipe fails | |
set -o pipefail |
This file contains hidden or 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
isyes= | |
read -p"Do you want to? " answer | |
if [[ ${answer:0:1} == 'y' || ${answer:0:1} == 'Y' ]]; then | |
isyes=1 | |
fi |
This file contains hidden or 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
USAGE=`printf "Usage: %s [--doa] [--textoption text] text\n -a, --doa : Do A\n --textoption : Store text" $(basename $0)` | |
# Get inputs | |
aflag="" | |
textoption="" | |
while test $# -gt 0; do | |
case $1 in | |
# Normal options | |
--textoption) |
This file contains hidden or 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
USAGE=`printf "Usage: %s [-a] text\n -a : Do A" $(basename $0)` | |
# Get the options | |
aflag= | |
while getopts 'a' OPTION; do | |
case $OPTION in | |
a) aflag=1 | |
;; | |
?) echo "$USAGE" | |
exit 1 |
This file contains hidden or 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
Show hidden characters
{ | |
"installed_packages": | |
[ | |
"DocBlockr", | |
"Generic Config", | |
"PackageResourceViewer", | |
"SideBarEnhancements", | |
"Sublime Bookmarks", | |
"SublimeCodeIntel", | |
"SublimeLinter", |
This file contains hidden or 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
{ | |
"always_prompt_for_file_reload": true, | |
"auto_complete_commit_on_tab": true, | |
"auto_match_enabled": false, | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"copy_with_empty_selection": false, | |
"font_face": "Droid Sans Mono", | |
"font_size": 9, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, |
This file contains hidden or 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
# Get an absolute path to our directory | |
basedir="$( cd "$(dirname "$0")" ; pwd -P )" |