See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
sass/ | |
| | |
|– base/ | |
| |– _reset.scss # Reset/normalize | |
| |– _typography.scss # Typography rules | |
| ... # Etc… | |
| | |
|– components/ | |
| |– _buttons.scss # Buttons | |
| |– _carousel.scss # Carousel |
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
@media (min-width:1281px) { /* hi-res laptops and desktops */ } |
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n |
In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.
Here's one way to set it up:
npm init -y
in your project folder (don't skip this step!)npm install terser
Now, to minify a file called like_button.js
, run in the terminal:
'use strict'; | |
// Требует node.js и пакета mkdirp | |
// Пакет mkdirp: https://www.npmjs.com/package/mkdirp#install — установить глобально или прописать установку в package.json, в секции devDependencies | |
// Использование: | |
// - поместить этот файл в корень проекта | |
// - исправить пути к генерируемым папкам и файлам, если блоки проекта лежат не в ./src/blocks/ | |
// - в терминале, будучи в корневой папке проекта, выполнить node createBlock.js [имя блока] [доп. расширения через пробел] | |
const fs = require('fs'); // будем работать с файловой системой |
<?php if ( have_posts() ) : query_posts('p=1'); | |
while (have_posts()) : the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php the_post_thumbnail(array(100, 100)); ?> | |
<?php endwhile; endif; wp_reset_query(); ?> |
import React, { useState, useEffect } from 'react' | |
import { useDebounce } from './use-debounce' | |
const MySearchComponent = props => { | |
const [search, setSearch, { | |
signal, | |
debouncing | |
}] = useDebounce('') | |
const [results, setResults] = useState([]) |