#Jekyll Base64 Encoder A Liquid tag for base64 encoding
Note: this plugin requires Colorize:
gem install colorize
#Jekyll Base64 Encoder A Liquid tag for base64 encoding
Note: this plugin requires Colorize:
gem install colorize
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Live demo of Nosy Facetype by Rory Harnden</title> | |
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,400italic' rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
@font-face { | |
font-family: "Nosy"; | |
src: url(NOSY_Facetype_by_Rory_Harnden.otf) format("opentype"); |
Function.prototype.runOnBackgroundThread = function (aCallback) { | |
var _blob = new Blob(['onmessage = '+this.toString()],{"type":"text/javascript"}); | |
var _worker = new Worker((webkitURL.createObjectURL || URL.createObjectURL)(_blob)); | |
_worker.onmessage = aCallback; | |
_worker.postMessage(); | |
} | |
var _test = function () { | |
postMessage((1+1).toString()); | |
} |
### | |
# JSONDB - a compressed JSON format | |
# By Devon Govett | |
# Originally proposed by Peter Michaux - http://michaux.ca/articles/json-db-a-compressed-json-format | |
# | |
# jsondb.pack converts an array of objects with the same keys (i.e. from a database) | |
# and flattens them into a single array, which is much smaller than the pure json | |
# representation where the keys are repeated for each item in the array. | |
# Combine with JSON.stringify to send compressed JSON data over the network. | |
# |
innerWidth / innerHeight tests @ http://sandbox.thewikies.com/orientation/ | |
-------------------------------------------------------------------------------- | |
Tested (14 devices, 28 browsers): | |
Droid 2 Global Android 2.2 | |
iPhone 4 iOS5 (Safari, Opera Mini) | |
Motorola Atrix Android 2.3.4 (Stock browser, Dolphin, Skyfire, Opera Mini, Firefox) | |
Samsung Galaxy S9000 Android 2.3 (Webkit, Opera Mobile) | |
Samsung Galaxy Y Android 2.3.5 |
// | |
// Tests if regular expression matches all valid ES6 import syntaxes. | |
// | |
// ES6 Language Specification Reference: | |
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-imports | |
// | |
const ES6_IMPORT_REGEX = /\bimport\s+(?:.+\s+from\s+)?[\'"]([^"\']+)["\']/g; | |
const VALID_ES6_IMPORT_SYNTAXES = [ |
_.mixin({ | |
sum : function(data){ | |
return _.reduce(data, function(memo, num){ return memo + num; }, 0); | |
}, | |
mean : function(data){ | |
return this.sum(data)/data.length | |
}, | |
median : function(data){ | |
return this.percentile(data,50); | |
}, |
/*!(C) WebReflection *//** @license Mit Style */ | |
// inspired by https://gist.github.com/4395291 | |
this.inherit || (this.inherit = function(create){ | |
if (!create) { | |
if ({__proto__:null} instanceof Object) { | |
for (var | |
Null = function Null() {}, | |
doc = document, | |
html = doc.documentElement, | |
iframe = html.insertBefore( |
// See https://jsperf.com/acorn-top-level-parsing-experiment/1 for example | |
acorn.plugins.top_level = function (instance) { | |
// Could skip other things as well, but this | |
// is where the most time can be saved | |
instance.parseBlock = function () { | |
var node = this.startNode(); | |
var length = this.context.length; | |
do { | |
this.next(); |