MyBoilerplate
For fast developing asaszievit
Some usefull commands
- open /Applications/Google\ Chrome.app --args --disable-web-security
- browser-sync start --server --files "css/*.css"
Some usefull links
- http://momentjs.com/ - for date
- http://fotorama.io/ - slider
- http://dimsemenov.com/plugins/magnific-popup/ - popup
- http://fancyapps.com/fancybox/ - popup
- http://masonry.desandro.com/ - incredible grids
- https://github.com/LPology/Simple-Ajax-Uploader - ajax uploader
- http://sapegin.github.io/social-likes/ru/ - social buttons
- http://ohmyz.sh/ - for command line
- http://www.softmaker.kz/articles/raznoe/nastrojka-xampp-na-mac-os-x.html - XAMPP
- http://www.mobilefish.com/services/base64/base64.php - compress svg
- http://www.browsersync.io/#install - browser sync
- http://www.smushit.com/ysmush.it/ - optimize img
- http://onjee.ru/3-servisa-chtoby-proverit-skorost-zagruzki-sajta/ - speed of load
- http://lorempixel.com/ - lorem pic
- https://github.com/noraesae/perfect-scrollbar - good scrollbar
- https://github.com/narfdotpl/jquery-typing - typing
- http://naikom.ru/blog/archives/4168 - cirillic fonts
- http://fronteed.com/iCheck/ - custom checkbox and radiobtn
- http://caniuse.com/ - can i use
- http://habrahabr.ru/post/252287/ - 22 photoshop plugins
Books
- http://largescalejs.ru/ - JS patterns(module, facade, mediator)
- http://habrahabr.ru/post/132472/ - JS patterns
Git
- git status
- git diff
- git add .
- git add -A
- git commit -m "Some message"
- git push origin master
- git pull
- git log
- git remote
- git remote add origin name_of_repo.git
- git branch -r
- git checkout some_branch
- git checkout -b some_branch
- git checkout --track -b some_branch origin/some_branch
- git push origin :heads/new_branch_name - delete remote branch
- git branch -d some_branch - delete local branch
- git merge some_branch
- git reset --hard
- git stash
- git stash pop
- git clone nam_of_repo.git
- git init
Plugins for Brackets
- Autoprefixer
- Brackets color pallete
- Brackets css color preview
- Brackets icons
- Code folding
- Colorhints
- CSSFier
- Emmet
- Everyscrub
- Extract for brackets
- Monokai Dark Soda
- Quick search
JS good practices:
-
while ( length-- ) { ... код ... }
-
Переменные объявляются в одном месте, желательно в начале функции.
-
Глобальных переменных быть не должно, максимум одна.
-
2 способа объявить глобальную переменную:
- var a = 0; - в данном случае a - глобальная переменная.
- a = 0; - в данном случае а - свойство глобального объекта window(в глобальном контексте this - window). Данное свойство можно удалить delete a. Плюс при парсинге кода браузером данное свойство будет инициализированно раньше, чем глобальная переменная в первом способе.
-
Coffescript
-
Замыкание:
var func1 = function(){
var a = 10;
return function(){
return a;
}
};
func1()(); // return 10
-
Режим "use strict" - режим строгой типизации
-
Именование переменных payment_val, именование функций paymentCalc, именование констант MAX_SIZE = 1000, именование приватных переменных, методов _init.