Skip to content

Instantly share code, notes, and snippets.

View sskoopa's full-sized avatar

SS Koopa sskoopa

View GitHub Profile
@sskoopa
sskoopa / Dockerfile
Created October 26, 2016 20:59
Dockerfile for using google-cloud (or any native module) and sharing app with Mac local
#alpine-node is a super small distro with just the minimum to run
FROM mhart/alpine-node:6
WORKDIR /app
#allow local code to mount into this directory
VOLUME /app
#move all native plugins up to -g installs and link them one level above the app
RUN npm install -g google-cloud && cd / && npm link google-cloud && cd /app
@sskoopa
sskoopa / webpack-size.sh
Created October 26, 2016 17:12
Why is my webpack bundle sooo big!?
#!/bin/bash
# This is intended for use with create-react-app
#npm install -g webpack-bundle-size-analyzer
NODE_ENV=production webpack --config node_modules/react-scripts/config/webpack.config.prod.js --json src/index.js | webpack-bundle-size-analyzer
@sskoopa
sskoopa / react-to-preact-codemod.js
Last active February 9, 2022 11:54
react -> preact codemod
// use via
// jscodeshift -t all.js src
//
const sourceOptions = { quote: 'single' }
/**
* Removes the named import: PropTypes
*/
const removeNamedImportPropTypes = (file, api) => {
const j = api.jscodeshift