use git diff to generate file list
git diff --name-only master
add ext filter
use git diff to generate file list
git diff --name-only master
add ext filter
#!/usr/bin/env bash | |
set -uo pipefail | |
IFS=$'\n\t' | |
# | |
# Improvements from dahjelle/pre-commit.sh: | |
# - does not lint deleted files, | |
# - lints all staged files before exiting with an error code, | |
# - handles spaces and other unusual chars in file names. | |
# |
var autoprefixer = require('gulp-autoprefixer'), | |
beml = require('gulp-beml'), | |
concat = require('gulp-concat'), | |
cssmin = require('gulp-minify-css'), | |
gulp = require('gulp'), | |
htmlmin = require('gulp-htmlmin'), | |
rename = require('gulp-rename'), | |
sass = require('gulp-sass'), | |
sync = require('browser-sync').create(); |
Английская версия: https://evilmartians.com/chronicles/bootstrap-an-intervention
У CSS есть несколько базовых проблем, которые позволяют очень быстро отстрелить себе ногу при неправильном использовании:
Глобальный неймспейс – в серверном программировании все что написано в файле, в файле и остается. Все же что написано в css и js засирает глобальное пространство имен со всеми вытекающими. В JS эту проблему сейчас побороли всякими модульными системами, а вот с css сложнее. В идеальном мире это должен починить Shadow DOM и настоящие Web Components, но пока их нет единственный способ с этим бороться – следовать какой-то системе именований селекторов, которая по возможности уменьшает и исключает возможные конфликты.
Каскадность – если на один элемент может сработать несколько правил, то они все и сработают последовательно. Если есть элемент h1.title
, на него сработают все правила для тегов h1
и все правила для класса .title
. Так как весь html состоит из тегов, то правил которые п
<snippet> | |
<content><![CDATA[ | |
<!-- begin $1 --> | |
<div class="$1"> | |
$2 | |
</div> | |
<!-- end $1 --> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>di</tabTrigger> |
$('a[href$="ABC"]') | |
// a[href$="ABC"] | |
------------------------------------- | |
= is exactly equal | |
!= is not equal | |
^= is starts with | |
$= is ends with | |
*= is contains |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).