This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> | |
<title></title> | |
<style> | |
.queue { | |
margin: 0; | |
padding: 0; |
This file contains hidden or 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
// Load an image in your browser and paste this in your console | |
var i=new Image();i.src=document.location.href;i.onload=function(){var c=document.createElement('canvas');c.width=this.width;c.height=this.height;c.getContext('2d').drawImage(this,0,0);window.location=c.toDataURL('image/png');}; |
This file contains hidden or 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
function charmin(dirty, whitelist) { | |
// returns sanitized HTML; accepts two arguments: | |
// (1) dirty: unescaped HTML | |
// (2) whitelist: array of allowed HTML tags | |
var div = document.createElement('div'); | |
document.createDocumentFragment().appendChild(div); | |
div.innerHTML = dirty; | |
var naughty = div.querySelectorAll(whitelist && whitelist.length ? ':not(' + whitelist.join('):not(') + ')' : '*'); | |
var i = naughty.length; | |
while (i--) { |
This file contains hidden or 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
This file contains hidden or 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
function makeSmart(obj) { | |
obj.__bound__ = {}; | |
} | |
function isSmart(obj) { | |
return '__bound__' in obj; | |
} | |
function makeSmartProperty(obj, property) { | |
var oldVal = obj[property]; |
This file contains hidden or 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
function Manifest(defaultObj) { | |
this.data = defaultObj || {}; | |
} | |
Manifest.prototype.render = function() { | |
console.log(JSON.stringify(this.data)); | |
}; | |
Manifest.prototype.set = function(k, v) { | |
this.data[k] = v; | |
this.render(); | |
}; |
This file contains hidden or 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
// Load a cross-origin image (using CORS). | |
// This continually updates an `img` element's `src` until an image's | |
// data URI has changed. | |
function loadExternalImage(uri, throbberUri) { | |
var canvas = document.createElement('canvas'); | |
var ctx = canvas.getContext('2d'); | |
var img = document.createElement('img'); |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
[ | |
{ | |
"id": 1, | |
"title": "Foo", | |
"body": "Foo foo foo!" | |
}, | |
{ | |
"id": 2, | |
"title": "Bar", | |
"body": "Bar bar bar!" |
This file contains hidden or 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
{ | |
"objectName": "WebPage", | |
"title": "Firefox Marketplace", | |
"frameTitle": "Firefox Marketplace", | |
"content": "<!DOCTYPE html><html manifest=\"/manifest.appcache?repo=fireplace\"><head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1\">\n <title>Firefox Marketplace</title>\n <meta property=\"og:title\" content=\"Firefox Marketplace\">\n <meta property=\"og:type\" content=\"website\">\n <meta property=\"og:image\" content=\"https://marketplace-dev-cdn.allizom.org/media/fireplace/img/logos/128.png?b=1390340222862\">\n <meta name=\"description\" content=\"The Firefox Marketplace is the official source of apps for the Web Platform.\">\n <link rel=\"icon\" href=\"https://marketplace-dev-cdn.allizom.org/media/fireplace/img/logos/128.png?b=1390340222862\" sizes=\"128x128\">\n <link rel=\"icon\" href=\"https://marketplace-dev-cdn.allizom.org/media/fireplace/img/logos/64.png?b=1390340222862\" sizes=\"6 |
This file contains hidden or 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
{ | |
"log": { | |
"version": "1.2", | |
"creator": { | |
"name": "PhantomJS", | |
"version": "1.9.0" | |
}, | |
"pages": [ | |
{ | |
"startedDateTime": "2014-01-21T22:50:41.316Z", |