Skip to content

Instantly share code, notes, and snippets.

@ghooghe
ghooghe / letsencrypt.yourdomain.conf
Created December 18, 2015 14:10 — forked from nwgat/letsencrypt.yourdomain.conf
lighttpd letsencrypt ssl conf
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/letsencrypt/live/yourdomain/ssl.pem"
ssl.ca-file = "/etc/letsencrypt/live/yourdomain/fullchain.pem"
ssl.dh-file = "/etc/ssl/certs/dhparam.pem"
ssl.ec-curve = "secp384r1"
ssl.honor-cipher-order = "enable"
ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
ssl.use-compression = "disable"
setenv.add-response-header = (
@ghooghe
ghooghe / loadicons.html
Created September 23, 2015 18:28 — forked from scottjehl/loadicons.html
load the icons
<head>
...
...
<script>
// async-load a stylesheet full of data-uri'd icons...
(function( href ){
links = document.getElementsByTagName( "link" ),
elem = document.createElement( "link" ),
ref = links[ links.length ];
@ghooghe
ghooghe / noncritcss.md
Created September 23, 2015 18:27 — forked from scottjehl/noncritcss.md
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:

@ghooghe
ghooghe / anchorinclude.js
Created September 23, 2015 18:25 — forked from scottjehl/anchorinclude.js
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>