Skip to content

Instantly share code, notes, and snippets.

View ogonkov's full-sized avatar

Alexey ogonkov

  • Belgrade, Serbia
View GitHub Profile
@ogonkov
ogonkov / README.md
Last active September 10, 2020 06:58
Mini CSS Extract Plugin error webpack-contrib/mini-css-extract-plugin#205
npm i
npm run build -- index.js
@ogonkov
ogonkov / index.js
Last active August 21, 2020 13:18
expose-loader bug
require('./test.xml');
fest.app();
@ogonkov
ogonkov / filters.md
Last active August 2, 2020 08:24
Jinja2 vs Nunjucks features comparison
Jinja2 Nunjucks Support
Filters 50 40 80%
Fully compatible 50 27 54%
Jinja2 Nunjucks Compatible Comment
abs abs ✔️ abs/Math.abs alias
attr
batch batch ✔️ same implementation
@ogonkov
ogonkov / README.md
Last active November 4, 2020 10:42
Misleading `mini-css-extract-plugin` error, see webpack-contrib/mini-css-extract-plugin#646

CSS Modules + HTMLWebpackPlugin

npm i
npm run build -- --entry ./index.js

Expected results

HTML emitted with `` and css chunk that inserted to html head.

@ogonkov
ogonkov / optimize-transliteration-charmap.js
Last active May 21, 2018 08:42
Reduce `charmap.json` of `transliteration` w/ Webpack loader
const ucs2decode = require('transliteration/lib/node/utils').ucs2decode;
// getAlphabet is just function that returns array of required chars for transliteration
const transliterationRanges = getAlphabet('а', 'я')
// A little bit of magic from `transliteration` sources, that used
// for searching symbols by charmap.json
.map((char) => ucs2decode(char) >> 8)
// Leave only unique values
.filter((char, i, chars) => (
chars.includes(char, Math.min(i + 1, chars.length)) === false
@ogonkov
ogonkov / README.md
Last active February 12, 2018 09:30
Get webpack entries asynchronously from dirs

Convert a bunch of dirs to Webpack entries

  foo
  |- bar
  |  `- index.js
  |- qux
  `- baz
     `- index.js
@ogonkov
ogonkov / .jscsrc.json
Last active August 29, 2015 14:03
Code Style settings
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch",
"case",
@ogonkov
ogonkov / ModulesManage.js
Last active August 29, 2015 14:03
Just a simple example of getting constructors from singleton.
/**
* Depends on Underscore `extend`.
*/
/**
* @namespace app
*/
window.app = app || {};
/**