Skip to content

Instantly share code, notes, and snippets.

Paul Kinlan PaulKinlan

Block or report user

Report or block PaulKinlan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dataUriForStylesheet.js
var toDataURI = function(datatype, data) {
return "data:" + datatype +";base64," + window.btoa(data);
var renderStyleSheet = function() {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = toDataUri("text/css", "body { background-color: red;}" );
PaulKinlan / gist:1222849
Created Sep 16, 2011 — forked from ianb/gist:1222633
Web Intent use case brainstorm
View gist:1222849

Use Cases

Screen scrape microdata:

  • grab an ical event (send)
  • grab an hcard
  • atom feed
  • make note of an hreview (actually I can't think of what you'd do with an hreview)
  • ? generic grabbing, or we specifically figure out support for particular kinds of data (i.e., specs)
View subscribe.html
<!doctype html>
<intent action="" type="application/atom+xml" />
<script src=""></script>
<button id="go">Go</button>
View edit-intent-tag.html
View gist:2853817
var i = new Intent({
"action": "",
"type": "image/*",
"data": blob
var onsuccess = function(data) {
var img1 = document.getElementById("img1");
img1.src = URL.createObjectURL(data);
View gist:2853874
window.addEventListener("load", function() {
if(window.intent && window.intent.action === "") {
var data =;
if(data instanceof Blob) {
// do something with the blob.
else {
// do something with the object.
View gist:2853982
var i = new Intent({
"action": "",
"type": "image/*",
"extras": { "url": "" }
var onsuccess = function(data) {
var img1 = document.getElementById("img1");
if(data instanceof Blob) {
img1.src = URL.createObjectURL(data);
View gist:2854138
var i = new Intent({
"action": "",
"type": "text/uri-list",
"data": ""
var onsuccess = function(data) {
var onerror = function(){ };
PaulKinlan / dabblet.css
Created Jul 19, 2012
The first commented line is your dabblet’s title
View dabblet.css
* The first commented line is your dabblet’s title
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
PaulKinlan / gist:4160675
Created Nov 28, 2012
Encapsulating Request Animation Frame
View gist:4160675
Javascript is a funny thing.
Here are two things that will hit you with requestAnimationFrame
1) If you alias the window.requestAnimationFrame function on to anything other
than a window object, you get an Illegal Invocation Error.
You can solve this by using call() with the window object set.
You can’t perform that action at this time.