Skip to content

Instantly share code, notes, and snippets.

View romanlex's full-sized avatar

Roman O romanlex

View GitHub Profile
@romanlex
romanlex / WG UDP hack on AsusWRT-Merlin.md
Created September 12, 2024 09:06 — forked from koolvn/WG UDP hack on AsusWRT-Merlin.md
UDP Trash Hack for WireGuard on AsusWRT Merlin

UDP Trash Hack for WireGuard on AsusWRT Merlin

Подготовка

Проверяем, что включен пункт меню Enable JFFS custom scripts and configs

image

Установка

  • Кладём файл wgclient-start в /jffs/scripts/
  • Делаем скрипт запускаемым
@romanlex
romanlex / BundleManifestPlugin.js
Last active February 15, 2023 15:29
Bundle manifest.json to defined var with ManifestPlugin for update frontend app
const { sources } = require('webpack')
const { getCompilerHooks } = require('webpack-manifest-plugin')
const PLUGIN_NAME = 'BundleManifestPlugin'
/** @typedef {import("webpack").Compiler} Compiler */
/**
* @typedef {Object} Options
* @property {string} to
@romanlex
romanlex / CollectEntriesRoutes.js
Created December 29, 2022 12:33
Plugin for collect routes path by entry points
const minimatch = require('minimatch')
const path = require('path')
const PLUGIN_NAME = 'CollectEntriesRoutesPlugin'
const routeMap = new Map()
/** @typedef {import("webpack").Compiler} Compiler */
/**
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import alias from 'rollup-plugin-alias'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json'
import filesize from 'rollup-plugin-filesize'
import resolve from 'rollup-plugin-node-resolve'
import replace from 'rollup-plugin-replace'
import { eslint } from 'rollup-plugin-eslint'
import cleaner from 'rollup-plugin-cleaner'
@romanlex
romanlex / rollup.config.js
Created October 1, 2018 11:07
Rollup config
import sass from 'rollup-plugin-sass'
import webworkify from 'rollup-plugin-webworkify'
import bundleWorker from 'rollup-plugin-bundle-worker'
import autoprefixer from 'autoprefixer'
import alias from 'rollup-plugin-alias'
import babel from 'rollup-plugin-babel'
import cjs from 'rollup-plugin-commonjs'
import cssurl from 'postcss-url'
import env from 'postcss-preset-env'
import json from 'rollup-plugin-json'
@romanlex
romanlex / 01-README.md
Created July 4, 2018 15:29 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@romanlex
romanlex / fetch.js
Last active June 4, 2018 11:33
Fetch multiple urls with fetch and save multiple response data
const RAW_CONTENT_TYPES = ['image/svg+xml']
/**
* Fetch url
*
* @param {string} url
*/
export const fetchResources = url => fetch(url, {
credentials: 'same-origin',
}).then((response) => {
[ignore]
<PROJECT_ROOT>/app/*
<PROJECT_ROOT>/bin/*
<PROJECT_ROOT>/config/*
<PROJECT_ROOT>/db/*
<PROJECT_ROOT>/doc/*
<PROJECT_ROOT>/dockerfiles/*
<PROJECT_ROOT>/engines/*
<PROJECT_ROOT>/kubernetes/*
<PROJECT_ROOT>/lib/*
@romanlex
romanlex / generateFlowModuleNameMappers.js
Created May 17, 2018 12:19 — forked from turadg/generateFlowModuleNameMappers.js
Helper to create .flowconfig module name mapper
#!/usr/bin/env node
/**
* Flowtype understands Node (or Haste) imports but not Webpack.
*
* Many codebases have webpack set up like:
* src/foo.js
* src/components/Bar.jsx
*
* And then import them like `require('foo')` or `require/components/Bar.jsx`
*
{
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'common',
children: true,
deepChildren: true,
minChunks: (module, count) => {
return count >= 3 && module.context && !module.context.includes('node_modules');
},