This file contains hidden or 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
function shimCssSupports() { | |
var cssToDOMregEx = /([a-z])-([a-z])/g; | |
function cssToDOMreplacer (str, m1, m2) { | |
return m1 + m2.toUpperCase(); | |
} | |
function cssToDOM(name) { | |
return name.replace(cssToDOMregEx, cssToDOMreplacer).replace(/^-/, ''); | |
} |
This file contains hidden or 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
const get = (obj = {}, path = '', defaultValue) => | |
path | |
.replace(/\[(.+?)\]/g, '.$1') | |
.split('.') | |
.reduce((o, key) => o[key], obj) || defaultValue; | |
// PERFORMANCE | |
// It's slower than lodash (surprise surprise), but it's about 97% smaller: | |
// https://jsperf.com/get-object-props/4 |
This file contains hidden or 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
export PATH := node_modules/.bin:$(PATH) | |
export SHELL := /usr/bin/env bash | |
.PHONY: dev | |
dev: check-nvm install # run `yarn dev` in .nvmrc-mandated node | |
@bash -l -c 'nvm exec --silent yarn -s dev' | |
.PHONY: install | |
install: # install deps using yarn in .nvmrc-mandated node | |
@bash -l -c 'nvm exec --silent yarn -s' |
This file contains hidden or 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
#!/bin/bash | |
log_error () { | |
echo -e "\x1b[31m$1\x1b[0m" | |
} | |
log_info () { | |
echo -e "\x1b[2m$1\x1b[0m" | |
} |
OlderNewer