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
| #!/usr/bin/ruby | |
| USAGE = "dataurize filename [mimetype] > filename.dataURI" | |
| require 'base64' | |
| mime = ARGV[1] || `file -ib '#{ARGV[0].gsub(/'/, "'\\\\''")}'`.strip | |
| STDOUT.write("data:#{mime};base64,") | |
| File.open(ARGV[0], 'rb') {|f| | |
| STDOUT.write(Base64.encode64(f.read(4500))) until f.eof? |
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
| /* MultiFile - A JavaScript library to load multiple files from | |
| tar archives and json_packed files (see http://gist.github.com/407595) | |
| Example: Loading multiple images from a tarball. | |
| MultiFile.load('images.tar', function(xhr) { | |
| this.files.forEach(function(f) { | |
| var e = document.createElement('div'); | |
| document.body.appendChild(e); | |
| var p = document.createElement('p'); |
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| <html><head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <script id="shader-fs" type="x-shader/x-fragment"> | |
| void main() { | |
| gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); | |
| } | |
| </script> |
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
| <html> | |
| <body> | |
| <h1 contenteditable id="title"></h1> | |
| <input id="edit"> | |
| <script src="model.js"></script> | |
| <script> | |
| var m = new Model(); | |
| m.sync('greeting', document.getElementById('edit'), 'value'); | |
| m.sync('greeting', document.getElementById('title'), 'innerText'); |
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
| # Compile the coffee in bare joined mode. | |
| {exec, spawn} = require 'child_process' | |
| fs = require 'fs' | |
| util = require 'util' | |
| print = (data) -> | |
| console.log data.trimRight() | |
| task 'build', 'Compile Coffeescript to Javascript', -> |
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
| gamepad_uncompressed.js | 69 ++++++++++++++--------------------------------- | |
| 1 file changed, 20 insertions(+), 49 deletions(-) | |
| diff --git a/gamepad_uncompressed.js b/gamepad_uncompressed.js | |
| index 5eb7a02..237a154 100644 | |
| --- a/gamepad_uncompressed.js | |
| +++ b/gamepad_uncompressed.js | |
| @@ -4,6 +4,10 @@ | |
| var getField = function() { | |
| return navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads; |
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 onOpen() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ]; | |
| ss.addMenu("HTTP Archive + BigQuery", menuEntries); | |
| } | |
| function runQuery() { | |
| var projectNumber = 'httparchive'; | |
| var sheet = SpreadsheetApp.getActiveSheet(); |
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
| #! /bin/bash | |
| SAVEIFS=$IFS | |
| IFS=$(echo -en "\n\b") | |
| outformat=mp4 | |
| indir=$1 | |
| cd "$indir" |
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
| <p>Hello | |
| <script> | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('GET', '/stream'); | |
| xhr.seenBytes = 0; | |
| xhr.onreadystatechange = function() { | |
| console.log("state change.. state: "+ xhr.readyState); |
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> | |
| <body> | |
| <h3>Hello SSE!</h3> | |
| <script> | |
| var source = new EventSource('/events'); | |
| // new connection opened callback | |
| source.addEventListener('open', function(e) { | |
| console.log('connection opened'); |