Skip to content

Instantly share code, notes, and snippets.

View saionaro's full-sized avatar

Artem Shibakov saionaro

View GitHub Profile
// If you want to use an embedded runtime chunk for one bundle and one common for the rest
const STANDALONE_ENTRYPOINT_NAME = "entry_name";
module.exports = {
...
optimization: {
...
runtimeChunk: {
name: ({ name }) => (name === STANDALONE_ENTRYPOINT_NAME ? STANDALONE_ENTRYPOINT_NAME : 'runtime')
},
@saionaro
saionaro / compress.js
Last active August 31, 2020 08:29
Images optimization script
const compressImages = require("compress-images");
const VERBOSE = false;
const WEBP_QUALITY = 65;
const JPEG_QUALITY = 75;
const PNG_QUALITY_MIN = 40;
const PNG_QUALITY_MAX = 75;
const DEST_DIR = "./src/images/";
const SRC_DIR = "./src/images/original";
@saionaro
saionaro / antd-icons.js
Created September 2, 2019 07:53
Cutting off extra Ant Design icons from a Webpack bundle. ~400 kb bundle size reduce
// export the only icons you need
export {
default as DownOutline
} from "@ant-design/icons/lib/outline/DownOutline";
export {
default as UpOutline
} from "@ant-design/icons/lib/outline/UpOutline";
@saionaro
saionaro / directUploading.ts
Last active October 13, 2020 12:31
A direct file uploading, react native edition
//...
// some interfaces imports skipped
//...
const createDirectUploadMutation = `
mutation createDirectUploadMutation(
$filename: String!
$byteSize: Int!
$contentType: String!
) {

Keybase proof

I hereby claim:

  • I am saionaro on github.
  • I am shibakow (https://keybase.io/shibakow) on keybase.
  • I have a public key ASArcoqDadaKO4CNaMyyx_lUY0Bry7eyUfP79XYc_sQZ8Qo

To claim this, I am signing this object:

const tests = [
[[3, 5, 6, 2, 1, 3, 6], 7],
[[5, 5, 7], 6],
[[4, 2, 1, 3, 7 ], 5],
[[9], 5],
[[1], 1],
[[1, 1, 4], 2],
[[1, 1, 4], 2],
[[9, 1, 3], 3],
[[67687, 667566, 4553334, 6566, 4332, 87886, 12321], 45456]
@saionaro
saionaro / 42.js
Created November 19, 2017 11:14
42
const forCheck = [
'({(){}()})()', //true
'({(}){})', //false
'{(({}))}', // true
'{}{}(){}{}{}{}{}', // true
'{}{{}}{()}', // true
'({}{)})', // false
'))((' // false
];