Skip to content

Instantly share code, notes, and snippets.

View iiison's full-sized avatar
🤝
Together, we can!

Bharat Soni iiison

🤝
Together, we can!
  • Singapore
View GitHub Profile
@iiison
iiison / watch.js
Created July 31, 2021 03:27
Watch object change
var obj = {
a : 'value',
b : 'another value'
}
var objProxy = new Proxy(obj, {
set(target, key, value) {
console.log({ key, value })
if (key === 'b') {
debugger
@iiison
iiison / super-tip.txt
Created May 18, 2021 06:45 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
/* global process :true, __dirname :true, module :true */
import path from 'path'
import webpack from 'webpack'
import minimist from 'minimist'
import TerserPlugin from 'terser-webpack-plugin'
import ManifestPlugin from 'webpack-manifest-plugin'
import PnpWebpackPlugin from 'pnp-webpack-plugin'
import safePostCssParser from 'postcss-safe-parser'
import HtmlWebpackPlugin from 'html-webpack-plugin'
@iiison
iiison / quicksort.js
Created June 16, 2020 08:28
basic quicksort implementation in JavaScript
function qs(arr, lf = 0, rt) {
function swap(ix1, ix2){
var temp = arr[ix1]
arr[ix1] = arr[ix2]
arr[ix2] = temp
}
rt = rt || arr.length - 1;
if (rt - lf === 1) {
@iiison
iiison / bug.svg
Last active August 13, 2019 04:12
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* global process :true, __dirname :true, module :true */
import path from 'path'
import webpack from 'webpack'
import TerserPlugin from 'terser-webpack-plugin'
import ManifestPlugin from 'webpack-manifest-plugin'
import PnpWebpackPlugin from 'pnp-webpack-plugin'
import safePostCssParser from 'postcss-safe-parser'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
@iiison
iiison / .eslintrc.js
Created January 23, 2019 07:40
eslint config
let Base = {
extends: ['airbnb', 'eslint:recommended', 'plugin:react/recommended'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
impliedStrict: true
@iiison
iiison / .eslintrc.js
Created January 23, 2019 07:40
eslint config
let Base = {
extends: ['airbnb', 'eslint:recommended', 'plugin:react/recommended'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
impliedStrict: true