Skip to content

Instantly share code, notes, and snippets.

@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@nicerobot
nicerobot / README.md
Last active February 25, 2024 02:41
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
@tommeier
tommeier / install_rvm.sh
Created February 10, 2011 00:20
Install RVM via bash script - Flawless Victory!
function install_rvm {
#Instructions : http://rvm.beginrescueend.com/rvm/install/
echo "===> Installing RVM >>"
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
#Reload shell
. ~/.rvm/scripts/rvm
result=`type rvm | head -1`
echo "===> Result of testing RVM : '$result'"