Skip to content

Instantly share code, notes, and snippets.

View artemsites's full-sized avatar

Artem Kuznecov artemsites

View GitHub Profile
@artemsites
artemsites / minification.md
Created November 18, 2021 19:21 — forked from gaearon/minification.md
How to Set Up Minification

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:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@artemsites
artemsites / result_modifier.php
Last active October 25, 2019 17:01 — forked from kvalexandr/Bitrix Next and Prev news.detail
Bitrix next and prev elements of news.detail. Следующий и предыдущий элемент в news.detail.
В result_modifier.php шаблона вставляем:
<?
/**
* Находим предыдущий и следующий элемент портфолио.
*/
// сортировку берем из параметров компонента
$arSort = array(
$arParams["SORT_BY1"] => $arParams["SORT_ORDER1"],
$arParams["SORT_BY2"] => $arParams["SORT_ORDER2"],
@artemsites
artemsites / gulpfile.js
Created October 4, 2019 10:27 — forked from LoyEgor/gulpfile.js
best image compression settings (gulp-imagemin)
// install
// npm i gulp-cache gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f
// node node_modules/jpegtran-bin/lib/install.js
// node node_modules/gifsicle/lib/install.js
// node node_modules/zopflipng-bin/lib/install.js
// node node_modules/mozjpeg/lib/install.js
// node node_modules/giflossy/lib/install.js
// node node_modules/pngquant-bin/lib/install.js