Skip to content

Instantly share code, notes, and snippets.

View cgiffard's full-sized avatar

Christopher Giffard cgiffard

  • Canberra, Australia
View GitHub Profile
@cgiffard
cgiffard / possibletracksyntax.html
Created March 19, 2011 00:36
Syntax idea for MediaTrack elements where multiple resource formats are required
<video controls autobuffer id="videoTest" width="1024" height="464">
<source src="video/arduino.m4v" type="video/mp4" />
<source src="video/arduino.webm" type="video/webm" />
<source src="video/arduino.ogv" type="video/ogg" />
<track kind="captions" src="video/arduino-en.srt" type="text/srt" srclang="en" label="English Subtitles" default />
<track kind="captions" src="video/arduino-de.srt" type="text/srt" srclang="de" label="German Subtitles" />
<track kind="captions" src="video/arduino-ja.srt" type="text/srt" srclang="ja" label="Japanese Subtitles" />
<track kind="commentary" srclang="en" label="Director's Commentary">
<source src="audio/commentary.ogg" type="audio/ogg" />
<source src="audio/commentary.mp3" type="audio/mp3" />
@cgiffard
cgiffard / example.vtt
Created June 29, 2011 03:51
WebVTT Metadata JS API Idea
WEBVTT
Language=zh
Kind=Caption
Version=V1_ABC
License=CC-BY-SA
Description=An example file demonstrating JS access for WebVTT metadata
COMMENT -->
This file was patched together from WebVTT examples here: http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/
@cgiffard
cgiffard / README.markdown
Created November 24, 2011 07:39
HTML5 video for Kickstarter

HTML5 Video for Kickstarter

Doesn't it annoy you that you can't watch any of the Kickstarter videos because you don't have flash?

This bookmarklet converts their player to a straight HTML5 <video> tag.

Unfortunately you'll need Safari, Chrome (well, for the near future anyway) or IE9/10, because Kickstarter videos are only available in H.264. Sorry.

@cgiffard
cgiffard / external-headers
Created September 3, 2012 04:19
HTTP Headers #1
HTTP/1.1 206 Partial Content
X-Powered-By: Steam Engines
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Cache-Control: public; max-age=31536000
Date: Mon, 03 Sep 2012 04:14:06 GMT
Last-Modified: Fri, 09 Mar 2012 05:46:44 GMT
ETag: "305947798-1331272004000"
Content-Type: video/mp4
Accept-Ranges: bytes
@cgiffard
cgiffard / ietest.js
Created September 24, 2012 10:22
Don't have a copy of IE8 available to me right now. Can anybody tell me whether this will work?
(window.attachEvent||window.addEventListener)("load",function() {
// Event listener code in here
alert("will this fire in IE8?");
},false);
@cgiffard
cgiffard / example-toggle.png
Last active December 11, 2015 22:19
Bookmarklet for making the LCA schedule toggle-able
example-toggle.png
@cgiffard
cgiffard / madhaxx.js
Created August 14, 2013 05:28
Guess what. Overloading the JS += operator is possible, if a little contrived and probably unusable!
var assert = require("assert");
var store = {};
function resolve(item) {
return store[item];
}
var FancyObject = function() {
var arrayProperty = [];
@cgiffard
cgiffard / canberrajs.md
Last active December 21, 2015 10:08
Canberra JS First Meetup, August 21st 6PM, Icelab
@cgiffard
cgiffard / significant.clip
Last active December 26, 2015 20:29
Significant whitespace
(middleware.register "logger"
(fn (number:status request:req hash:res)
(io.print (% "[%00d] %s" status req.url))))
middleware.register "logger"
fn
number:status request:req hash:res
io.print
% "[%00d] %s" status req.url
@cgiffard
cgiffard / safari-tabs.js
Created April 26, 2014 12:51
Nasty hack to get Safari Tabs In Node
var applescript = require("applescript");
var getTabs = ' \n\
tell application "Safari" \n\
set urllist to URL of every tab of every window \n\
set namelist to name of every tab of every window \n\
\n\
set theDoc to "" as string \n\
set windowcount to length of urllist \n\
\n\