Languages
166 gist results
166 gist results
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
| # .bashrc | |
| # Source global definitions | |
| if [ -f /etc/bashrc ]; then | |
| . /etc/bashrc | |
| fi | |
| # User specific aliases and functions | |
| PATH=$HOME/bin:$PATH |
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
| ### Automatically switch prompt when git-prompt is present | |
| if [ -f /etc/bash_completion ] ; then | |
| . /etc/bash_completion | |
| fi | |
| if [ -f /etc/bash_completion.d/git-prompt ] ; then | |
| export PS1='\[\033[01;32m\]\u@\h\[\033[01;33m\] \w$(__git_ps1) \n\[\033[01;34m\]\$\[\033[00m\] ' | |
| else |
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
| if [ -f /Applications/NetBeans/glassfish-4.0/bash_completion.d/asadmin ]; then | |
| . /Applications/NetBeans/glassfish-4.0/bash_completion.d/asadmin | |
| 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
| function send_email { | |
| curl --url "smtps://smtp.gmail.com:465" --ssl-reqd \ | |
| --mail-from "symbolic.contrast@gmail.com" --mail-rcpt "$1" \ | |
| --upload-file $2 --user "symbolic.contrast@gmail.com:$GMAIL_PASSWORD" --insecure | |
| } | |
| # replace symbolic.contrast with your email | |
| # and export GMAIL_PASSWORD | |
| # command line options are <recipient> <mail file> | |
| # i.e. send_email maxpleaner@gmail.com mail.txt |
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
| # | |
| # ~/.bashrc | |
| # | |
| # If not running interactively, don't do anything | |
| [[ $- != *i* ]] && return | |
| # Aliases | |
| alias ls='ls --color=auto' | |
| alias vi='nvim' |
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
| # >>> custom prompt PS1 >>> | |
| export GIT_PS1_SHOWDIRTYSTATE=1 | |
| export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
| export GIT_PS1_SHOWUPSTREAM=auto | |
| TRIANGLE_SYM=$'\ue0b0' | |
| function prompt_func() { | |
| # IMPORTANT: Non-printable sequences should be enclosed in \[ and \] | |
| if [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then # inside a git repo | |
| gitsubdir=$(basename $(git rev-parse --show-toplevel))/$(git rev-parse --show-prefix) |
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
| PS1_BASE="$PS1" | |
| format_prompt () { | |
| if [ "$?" -ne "0" ]; then | |
| PS1="${PS1_BASE}\[\033[0;31m\]ಠ_ಠ\[\033[0m\] " | |
| else | |
| PS1="${PS1_BASE}" | |
| fi | |
| } | |
| PROMPT_COMMAND=format_prompt |
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
| function cdgem { | |
| cd `dirname \`gem which $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
| # Go goodies | |
| export GOROOT=~/code/golang | |
| export GOPATH=~/code/goexts | |
| # My Go Goodies | |
| export GOPATHDEV=~/code/gopath | |
| export GOPATH=$GOPATH:$GOPATHDEV | |
| export GOBIN=$(echo $GOROOT:$GOPATH/bin | sed s#:#/bin:#g) | |
| export PATH=$PATH:~/bin:$GOBIN |
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
| dddd | |
| ddddddd |