Skip to content

Instantly share code, notes, and snippets.

pibby / critcss.snippet.js
Last active Aug 23, 2020 — forked from james-Ballyhoo/critcss.snippet.js
Critical CSS Finder w/media query support for those of us who write mobile-first CSS; will output to console; configurable viewport height on line 12.
View critcss.snippet.js
/* Critical CSS Finder w/media query support and output to console
by Katie Harron - -
forked from james-Ballyhoo ( who forked from PaulKinlan (
I don't know why this isn't keeping my 2 space indents :(
(function() {
function findCriticalCSS(w, d) {
// Pseudo classes formatting
var formatPseudo = /([^\s,\:\(])\:\:?(?!not)[a-zA-Z\-]{1,}(?:\(.*?\))?/g;
View gist:1488f040392e3aeeaaf0
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
View Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using (iTerm has mouse support)
Then install
# More on mouse support

My Git Deploy Workflow

I use this for static and simple [Sinatra][1] based sites -- great for prototyping simple apps. Credit goes to for the original idea.

If you don't know what this is, here's an example of how I deploy my website/app to a server:

# create/update/delete files in my site
git add .
git commit -m "description of the changes I made"

git push

# Deploying a Sinatra app to Heroku
## Database
The location of the database Heroku provides can be found in the environment
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example
on how to use this.
## Server
Heroku is serving your apps with thin, with means you have all your thin goodness available,
such as EventMachine.

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

View 0001-ufw-Initial-firewall-config-on-OpenVZ-VPS.patch
From eccc80a754273641c2e0532be98987c8e89e960e Mon Sep 17 00:00:00 2001
From: root <>
Date: Fri, 28 Jun 2013 20:38:12 +0400
Subject: [PATCH] ufw: Initial firewall config on OpenVZ VPS
* OpenVZ vps doesn't have all the kernel features needed by
Ubuntu 12.04 LTS, disable unsupported features so firewall
starts cleanly.
default/ufw | 4 ++--