Skip to content

Instantly share code, notes, and snippets.

(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@gaspanik
gaspanik / screenshots.js
Last active December 17, 2015 12:19 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Original:
* nhoizey / screenshots.js https://gist.github.com/nhoizey/4060568
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
<VirtualHost *:80>
ServerName pow
ServerAlias *.dev
ServerAlias *.xip.io
ProxyPass / http://localhost:20559/
ProxyPassReverse / http://localhost:20559/
ProxyPreserveHost On
</VirtualHost>
@gaspanik
gaspanik / httpd.conf
Last active December 13, 2015 17:09 — forked from deroter/httpd.conf
#
# Mac OS X / Mac OS X Server
# The <IfDefine> blocks segregate server-specific directives
# and also directives that only apply when Web Sharing or
# server Web Service (as opposed to other services that need Apache) is on.
# The launchd plist sets appropriate Define parameters.
# Generally, desktop has no vhosts and server does; server has added modules,
# custom virtual hosts are only activated when Web Service is on, and
# default document root and personal web sites at ~username are only
# activated when Web Sharing is on.
@gaspanik
gaspanik / default.conf
Created September 29, 2012 00:13 — forked from wokamoto/default.conf
Nginx: default.conf
server {
listen 80 default;
server_name _;
root /path/to/wordpress;
index index.html index.htm;
charset utf-8;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
@gaspanik
gaspanik / .htaccess
Last active August 29, 2015 14:10 — forked from thoop/.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On