PS1='\u:\W$ '
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
type: | |
subl ~/.profile | |
enter | |
# set Aliases | |
alias gs='git status' | |
alias ga='git add' | |
alias gb='git branch' | |
alias gc='git commit' | |
alias gd='git diff' |
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
type: | |
subl ~/.gitconfig | |
enter | |
[user] | |
email = MilanG@aol.com | |
name = Milan Grubnić | |
[color] | |
ui = true | |
[credential] |
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
Type: | |
nano ~/.profile_bash | |
ctrl + o | |
enter | |
ctrl + x | |
to use: | |
echo "Hello, Milan Grubnić!" | |
alias his="history" | |
alias hist="history" |
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
[ | |
{ "keys": ["alt+c"], | |
"command": "insert_snippet", | |
"args": { | |
"contents": "console.log(${1:}$SELECTION);${0}" | |
} | |
} | |
] | |
// alt + c will get you console.log(_) |
Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
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
US Zip Code REGEX | |
var ZipCode = /\d{5}(-\d{4})?/; | |
if you want to make sure the string ONLY contains a Zip Code use the ^ and $ to match the beginning and ending of the string like this: | |
var ZipCode = /^\d{5}(-\d{4})?$/; | |
US Phone Number REGEX | |
var phoneNum = /\(?(\d{3})\)?[ -.](\d{3})[ -.](\d{4})/; | |
if you want to make sure the string ONLY contains a phone number use the ^ and $ to match the beginning and ending of the string like this: | |
var ZipCode = /^\(?(\d{3})\)?[ -.](\d{3})[ -.](\d{4})$/; |
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
Terminal shortcuts go in .bashrc in the home directory. | |
alias gs='git status ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit' | |
alias gd='git diff' | |
alias go='git checkout ' | |
alias gk='gitk --all&' | |
alias gx='gitx --all' |
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
git log --pretty=oneline | |
git log --pretty=oneline --max-count=2 | |
git log --pretty=oneline --since='5 minutes ago' | |
git log --pretty=oneline --until='5 minutes ago' | |
git log --pretty=oneline --author=<your name> | |
git log --pretty=oneline --all | |
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short |
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
$('a').click(function(evt){ | |
// JavaScipt goes here | |
evt.preventDefault(); // don't follow link | |
}); |