Skip to content

Instantly share code, notes, and snippets.

Close 2nd to surfin'

Jeff Wainwright yowainwright

Close 2nd to surfin'
Block or report user

Report or block yowainwright

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
getify / 1.js
Last active Apr 11, 2019
tag function for formatting console.log(..) statements
View 1.js
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;



  • ✏️ method changes this.
  • 🔒 method does not change this.


  • concat(...items: Array<T[] | T>): T[] 🔒 ES3
rodneyrehm / polyfill-intl.js
Created Aug 21, 2017
Webpack: load Intl polyfill with languages
View polyfill-intl.js
const needsPolyfill = !window.Intl
/* eslint-disable import/no-webpack-loader-syntax */
const intl = require('bundle-loader?lazy&name=intl!intl')
/* eslint-enable import/no-webpack-loader-syntax */
const polyfilled = needsPolyfill && new Promise(resolve => {
#!/bin/bash -
# USAGE: Update all the git repos in your ~/code directory. This will
# skip over "dirty" (code changed and uncommited) repos and
# give a warning and, after completion, list those repos.
# The script will ask if you want to npm install or npm build
# in the frontend repos, default is "n" (no).
int128 /
Last active Sep 20, 2019
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

robdodson / index.html
Last active Sep 6, 2019
Shady DOM example
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<h2>Hello from outside the Shadow DOM!</h2>
nrollr /
Last active Nov 7, 2019
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

briangonzalez /
Last active Sep 8, 2016
Atom - Dark Title Bar
# A prettier Atom via PR #10208.
# Quit then remove.
osascript -e 'quit app "Atom"'
rm -rf /Applications/
# Install, build, then open.
git clone -b pb-hidden-inset-1.8
cd atom

Redux Selector Pattern

Imagine we have a reducer to control a list of items:

function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
  switch(action.type) {
    case 'SHOW_ALL_ITEMS':
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
You can’t perform that action at this time.