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
"use strict"; | |
self.addEventListener('fetch', function(event) { | |
var request = event.request, | |
url = request.url, | |
url_object = new URL( url ), | |
re_jpg_or_png = /\.(?:jpg|png)$/, | |
supports_webp = false, // pessimism | |
webp_url; |
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
# A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. | |
# by: Brandon Tilly | |
# Source URL: https://gist.github.com/1027674 | |
# Post http://brandontilley.com/2011/01/31/gist-tag-for-jekyll.html | |
# | |
# Example usage: {% gist 1027674 gist_tag.rb embed %} //embeds a gist for this plugin | |
require 'cgi' | |
require 'digest/md5' | |
require 'net/https' |
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
... | |
// test for font-face version to load via Data URI'd CSS | |
// Basically, load WOFF unless it's android's default browser, which needs TTF, or ie8-, which needs eot | |
var fonts = ns.files.css.fontsWOFF, | |
ua = win.navigator.userAgent; | |
// android webkit browser, non-chrome | |
if( ua.indexOf( "Android" ) > -1 && ua.indexOf( "like Gecko" ) > -1 && ua.indexOf( "Chrome" ) === -1 ){ | |
fonts = ns.files.css.fontsTTF; | |
} |