The true cause of frontend SPOF is loading a script, stylesheet, or font file in a blocking manner.
This file contains 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
sudo chown -R `whoami` ~/.npm | |
sudo chown -R `whoami` /usr/local/lib/node_modules |
This file contains 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
# Set Up Launch Agent to Run On Startup | |
function set_launch_agent() { | |
# retrieve the dependency's prefix | |
DEP_PREFIX=$(brew --prefix ${1}) | |
# make the user local LaunchAgents directory (skip if already exists) | |
mkdir -p ~/Library/LaunchAgents | |
# copy brew generated plist to LaunchAgent | |
cp $DEP_PREFIX/*${1}*.plist ~/Library/LaunchAgents/ | |
# load the agent now | |
launchctl load -w ~/Library/LaunchAgents/*${1}*.plist |
This file contains 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
npm ls --depth 0 -g |
This file contains 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
// this would be set in a closure | |
// but leave some values to be cached (ie not created every function call) | |
// and the ability to override | |
var norm_regex = /\s+/g; | |
var norm_replace = "_"; | |
function normalize( val, reg_pattern, separator ) { | |
// convert to string | |
var norm_val = val+""; | |
norm_regex = reg_pattern || norm_regex; |
NewerOlder