Skip to content

Instantly share code, notes, and snippets.

View BiosBoy's full-sized avatar
⛰️
The bigger you know - the less you scared of.

Sviat Kuzhelev BiosBoy

⛰️
The bigger you know - the less you scared of.
View GitHub Profile
@BiosBoy
BiosBoy / linting.yml
Created October 30, 2020 12:13
Linting CI workflow based on GitHub Actions. For JavaScript/React projects
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Linting
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
@BiosBoy
BiosBoy / Configuration file for Webpack 4 + Webpack Hot Module Replacement + BrowserSync + React 16.js
Last active November 12, 2020 03:16
Configuration file for Webpack 4 + Webpack Hot Module Replacement + BrowserSync + React 16
//App structure:
// app_folder/
// webpack.config.js
// /server/
// server.js
// /src/
// index.js
// How to run: from root folder run command: "node server/server"
const flatter = args => {
const arr = [...args]
const arrFlat = []
const _iterator = (arrTemp) => {
arrTemp.forEach(item => item.push ? _iterator(item) : arrFlat.push(item))
return arrFlat
}
const setValue = state => {
this.state = state || 0
this.set = value => {
this.state += value
return setValue(this.state)
}
this.get = () => this.state
const carr = a => b => !b ? a : carr(a + b)
const result = carr(1)(2)(12)(22)()
console.log(result)
const strToObj = (arg) => {
const arr = arg.push ? arg : arg.split('.')
const obj = {}
const _recursiveParsing = (arrBuff, objBuff) => {
if (arrBuff.length === 0) {
return obj
}
const webpack = require('webpack')
const path = require('path')
// CSS Optimization Plugins
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
// JS Optimization Plugins
const TerserPlugin = require('terser-webpack-plugin')
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-no-unsupported-browser-features",
"stylelint-order"
],
"ignoreFiles": ["**/*.js","**/*.jsx","**/*.ts","**/*.tsx","**/*.html"],
"rules": {
"declaration-block-no-redundant-longhand-properties": [
true,
// CONSTANTS
$pixels-density-list: 1 2;
$webp-support: '.webp-support';
$webp-format: 'webp';
// LAYOUTS LIST BELOW
$resoultions-tablet_mobile: tablet 'max-width: 1000px', mobile 'max-width: 600px';
$resoultions-only_tablet: tablet 'max-width: 1000px',; // "," - is a hack for a single object props;
$resoultions-only_mobile: mobile 'max-width: 600px',; // "," - is a hack for a single object props;
var timerID = null
document.addEventListener('dblclick', function() {
console.log('double click!');
if (timerID) {
clearTimeout(timerID);
timerID = null;
}