fix - Code changes linked to a known issue.
feat - New feature.
hotfix - Quick fixes to the codebase.
junk - Experiments (will never be merged).
refactor - A code change that neither fixes a bug nor adds a feature
ci - Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// script to enable webpack-bundle-analyzer | |
process.env.NODE_ENV = 'production'; | |
const webpack = require('webpack'); | |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') | |
.BundleAnalyzerPlugin; | |
const webpackConfigProd = require('react-scripts/config/webpack.config.prod'); | |
webpackConfigProd.plugins.push(new BundleAnalyzerPlugin()); | |
// actually running compilation and waiting for plugin to start explorer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// script to enable webpack-bundle-analyzer | |
process.env.NODE_ENV = 'production'; | |
const webpack = require('webpack'); | |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') | |
.BundleAnalyzerPlugin; | |
const webpackConfigProd = require('react-scripts/config/webpack.config')('production'); | |
webpackConfigProd.plugins.push(new BundleAnalyzerPlugin()); | |
// actually running compilation and waiting for plugin to start explorer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pase these lines into website's console ( Ctrl/Cmd + Shift + I ) | |
if(!!window.React || | |
!!document.querySelector('[data-reactroot], [data-reactid]')) | |
console.log('React.js'); | |
if(!!window.angular || | |
!!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') || | |
!!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]')) | |
console.log('Angular.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let array_1 = [1,2,3,4]; | |
let array_2 = [1,2,3,4]; | |
let array_3 = [1,2,3,4]; | |
array_1.splice(-1,1) // output --> [4] array_1 = [1,2,3] | |
array_2.slice(0,-1); // output --> [1,2,3] array_2 = [1,2,3,4] | |
array_3.pop(); // output --> 4 array_3 = [1,2,3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (config) { | |
config.set({ | |
... | |
browsers: ['Chrome', 'ChromeHeadlessNoSandbox'], | |
customLaunchers: { | |
ChromeHeadlessNoSandbox: { | |
base: 'ChromeHeadless', | |
flags: ['--no-sandbox'] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "12" | |
addons: | |
chrome: stable | |
env: | |
global: | |
CODECOV_TOKEN=$CODECOV_TOKEN | |
before_script: | |
- yarn install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bisect | |
class SortedArray: | |
def __init__(self, array): | |
self.array = sorted(array) | |
self.d = len(array) | |
def add(self, x): | |
bisect.insort(self.array, x) | |
def remove(self, x): | |
del self.array[bisect.bisect_left(self.array, x)] | |
def median(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -r -p -U Mozilla --wait=10 www.website.com |