- Always use '===' instead of '==' for comparison
this.id
is better than$(this).attr('id')
- "use strict"
- Never leave out optional curly brackets, even for one-line statements.
- Get elements by id wherever possible
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
// Super simple mobile-first breakpoint mixin: | |
@mixin breakpoint($from) { | |
@media screen and (min-width: $from) { @content; } | |
} | |
// Example usage: | |
$small: 480px; | |
nav { | |
@include breakpoint($small) { | |
display: none; |
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 --graph --date-order --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(yellow) %an %Creset' --abbrev-commit --date=relative |
- Add mintty.exe to Git\bin
- Create shortcut in Git directory with the following target:
"C:\Program Files\Git\bin\mintty.exe" --title "Git mintty" --icon "etc\git.ico" -c "%HOMEDRIVE%%HOMEPATH%\.minttyrc" --icon "etc\git.ico" --exec "bin\sh.exe" --login -i
('Starts in' should be set to "C:\Program Files\Git" in order for relative paths, eg. "etc\git.ico", to work) - In order to get colours working, add the following to .gitconfig:
[color] status = always diff = always
log = always
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
## Global variables: | |
export PATH=/c/Program\ Files/cwRsync/:/c/Users/Nick/AppData/Roaming/npm/:$PATH | |
export VAGRANT_HOME=/c/HashiCorp/Vagrant/.vagrant.d/ | |
## Custom Bash Prompt: | |
export PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ ' | |
## For nice diffs: | |
# install diff-so-fancy (npm -g diff-so-fancy) | |
# set pager to use it (git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX") |
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
Show hidden characters
[ | |
// My Sublime shortcuts: | |
{ "keys": ["ctrl+k", "ctrl+m"], "command": "toggle_minimap" }, | |
// jEdit shortcuts: | |
{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["alt+right"], "command": "indent" }, | |
{ "keys": ["alt+left"], "command": "unindent" }, | |
{ "keys": ["ctrl+e", "ctrl+c"], "command": "toggle_comment", "args": { "block": false } }, | |
{ "keys": ["ctrl+e", "ctrl+w"], "command": "close_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 | |
alias ga='git add' | |
alias gb='git branch --sort=-committerdate' | |
alias gbr="git for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)'|column -ts'|'" | |
alias gco='git checkout' | |
alias gcm='git commit -m' | |
alias gcv='git commit -v' | |
alias gd='git diff' | |
alias gl="git log -n 15 --graph --date-order --date=relative --pretty=format:'%C(red)%h%C(reset)%C(auto)%d%C(reset) %s %C(green)(%cr) %C(yellow) %an %C(reset)'" | |
alias gm='git merge' |
A command line fuzzy finder
https://github.com/junegunn/fzf
Simplified and community driven man pages with useful examples
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
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme", | |
"default_line_ending": "unix", | |
"enable_tab_scrolling": false, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
"*~", | |
"*.exe", |
OlderNewer