Skip to content

Instantly share code, notes, and snippets.

@vimcaw
vimcaw / craco.config.js
Created May 16, 2020 02:59
Using craco to override creat-react-app htmlWebpackPlugin options
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = () => {
return {
webpack: {
configure: (webpackConfig, { env }) => {
if (env !== 'development') {
const htmlWebpackPluginInstance = webpackConfig.plugins.find(
webpackPlugin => webpackPlugin instanceof HtmlWebpackPlugin
);
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/
@rtyley
rtyley / get-500-biggest-blobs.sh
Last active September 13, 2022 10:54
Gets the top 500 biggest blobs in your repo, ordered by size they occupy when compressed in the packfile
git verify-pack -v .git/objects/pack/*.idx | grep blob | cut -c1-40,48- | cut -d' ' -f1,3 | sort -n -r --key 2 | head -500 > top-500-biggest-blobs.txt
@pamelafox
pamelafox / senderror.js
Created February 21, 2012 19:20
Sending JS errors to server
function sendError(message, url, lineNum) {
var i;
// First check the URL and line number of the error
url = url || window.location.href;
lineNum = lineNum || 'None';
// If the error is from these 3rd party script URLs, we ignore
// We could also just ignore errors from all scripts that aren't our own
var scriptURLs = [