Skip to content

Instantly share code, notes, and snippets.

View JT5D's full-sized avatar
💭
Multiversing...

JT5D JT5D

💭
Multiversing...
View GitHub Profile
@JT5D
JT5D / dataurize.rb
Created November 10, 2013 18:01 — forked from kig/dataurize.rb
#!/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?
@JT5D
JT5D / multifile.js
Created November 10, 2013 18:01 — forked from kig/multifile.js
/* 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');
@JT5D
JT5D / simple20.html
Created November 10, 2013 18:01 — forked from kig/simple20.html
<!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>
@JT5D
JT5D / index.html
Created November 10, 2013 18:01 — forked from kig/index.html
<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');
@JT5D
JT5D / Cakefile
Created November 10, 2013 20:16 — forked from gotascii/Cakefile
# 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', ->
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;
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();
@JT5D
JT5D / ivideo.sh
Created November 11, 2013 05:15 — forked from igrigorik/ivideo.sh
#! /bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
outformat=mp4
indir=$1
cd "$indir"
@JT5D
JT5D / index.html
Created November 11, 2013 05:15 — forked from igrigorik/index.html
<p>Hello
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', '/stream');
xhr.seenBytes = 0;
xhr.onreadystatechange = function() {
console.log("state change.. state: "+ xhr.readyState);
@JT5D
JT5D / index.html
Created November 11, 2013 05:15 — forked from igrigorik/index.html
<!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');