Skip to content

Instantly share code, notes, and snippets.

// npm install --save-dev webpack-bundle-analyzer
process.env.NODE_ENV = "production"
var BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin
const webpackConfigProd = require("react-scripts/config/webpack.config.prod")
webpackConfigProd.plugins.push(
new BundleAnalyzerPlugin({

React PropTypes Intellisense - Visual Studio Marketplace

ES7 React/Redux/GraphQL snippets - Visual Studio Marketplace rccp boilerplates a class Component with Proptypes exports and imports, their snippets are really good and customizable

EditorConfig for VS Code - Visual Studio Marketplace if you are working with teammates who use vscode and are using prettier or eslint I stroooonnngggly recommend adding a .editorconfig to the root of your project

Auto Rename Tag - Visual Studio Marketplace Auto Close Tag - Visual Studio Marketplace

.c-virtual_list__scroll_container {
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet) !important;
}
p, span, h1, h2, h3, h4, h5, div, section, article, body {
font-family: "Comic Sans MS", cursive, sans-serif !important;
}
.member_image{
-webkit-animation: spinToWin 5s infinite; /* Safari 4.0 - 8.0 */
animation: spinToWin 5s infinite;
git clone https://github.com/nodenv/nodenv.git ~/.nodenv
ln -s "$SYSTEM_REPO/Dotfiles/config/nodenv/default-packages" ~/.nodenv/
( mkdir ~/.nodenv/plugins && cd ~/.nodenv/plugins && \
for PLUGIN in node-build node-build-update-defs nodenv-aliases \
nodenv-default-packages nodenv-each nodenv-package-rehash; do
git clone "https://github.com/nodenv/$PLUGIN.git"
done )
nodenv update-version-defs
@rrichardsonv
rrichardsonv / consoleUtils.js
Last active November 30, 2018 21:54
Github Console Scripts and Utils
function githubCollapseAll(){
const buttons = document.getElementsByTagName('button');
let results = [];
for(let i = 0, j = buttons.length; i<j; i++) {
let button = buttons[i]['attributes']['aria-label']
if(button && button['value'] === "Toggle diff contents"){
buttons[i].click();
}
}
}
@rrichardsonv
rrichardsonv / bad_identation patter
Created July 17, 2019 15:19
match_2spaces_regex
// (preceded by beginning of line or beginning of line followed by 2 or more spaces)
// a group of 2 spaces
// (followed by any number of spaces and ending with <)
(^|(?<=^\s{2,}))(\s{2})(?=\s*<)
@rrichardsonv
rrichardsonv / stream.js
Created January 15, 2020 15:42
elixir style stream
class Stream {
constructor (collection) {
this.collection = collection
this.transformations = []
this.acc = []
}
run () {
let acc = this.acc
let i = -1
defmodule GoIntumerables do
@doc """
## Example
take_into(%Bar{id: 1}, [:id], [])
# => [id: 1]
opts = [open: true, secret: "foo", source_id: "2"]
opts
@rrichardsonv
rrichardsonv / ntest.ex
Created March 18, 2020 16:56 — forked from cblavier/ntest.ex
Parallel test runner
defmodule Mix.Tasks.NTest do
use Mix.Task
@wildcard "apps/*/test/**/*_test.exs"
def run([i, n | args]) do
{i, _} = Integer.parse(i)
{n, _} = Integer.parse(n)
test_paths =
@rrichardsonv
rrichardsonv / shunt_on_em.ex
Created May 8, 2020 17:25
Shunting yard elixir implementation for keyword list tokens
defmodule ShuntOnEm do
@moduledoc """
Shunting yard algorithm as explained at https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Refactored and repurposed from https://gist.github.com/pixyj/73bebd14be17ce680e9219f642044964
For use, primarily in traversing tokens produced by the wonderful nimbleparsec
## Examples
```