Skip to content

Instantly share code, notes, and snippets.

@tra38
Last active April 22, 2018 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tra38/e35856c62d0c684a5151cd001b694226 to your computer and use it in GitHub Desktop.
Save tra38/e35856c62d0c684a5151cd001b694226 to your computer and use it in GitHub Desktop.
Personalized Bash Settings
#Personal Aliases
alias be="bundle exec"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:$HOME/Library/Python/3.6/bin" # Add Python 3.6 to PATH for command-line tools

#Remove the beer in Homebrew
export HOMEBREW_NO_EMOJI=1

#Default Search Behaviors for "howdoi":
alias howdoi='howdoi -n3 -a -c'

#The default behavior does three things:
#display three answers to the question
#show complete answers with link, explaination, and (possibly) code
#use of colors to highlight code

#These default behaviors can easily be overriden...for example 
#"howdoi solve the halting problem -n 1" is translated to
#"howdoi -n3 -a -c solve the halting power -n 1"...
#The later "n" overrides the earlier n, so we only get
#one answer, not three answers.

# We can configure what sites "howdoi" visit to find answers by setting the HOWDOI_URL
# environment variable. We can take advantage of this behavior by defining
# custom "howdoi functions" for different sites on the StackExchange network.

#This is a factory we can use to generate those custom functions.
function howdoi-factory
{
  command=$(printf '%q() { HOWDOI_URL=%q howdoi "$@"; }' "$1" "$2")
  eval $command
}

# Then we generate howdoi functions for the following sites:
# Software Engineering
howdoi-factory howdoi-engineer softwareengineering.stackexchange.com

# Ethereum
howdoi-factory howdoi-eth ethereum.stackexchange.com

# Apple
howdoi-factory howdoi-apple apple.stackexchange.com

# Computer Science
howdoi-factory howdoi-cs cs.stackexchange.com

# Server Fault
howdoi-factory howdoi-server serverfault.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment