Skip to content

Instantly share code, notes, and snippets.

@giorrrgio
giorrrgio / raphael-svg-buildjson
Created August 27, 2012 09:49 — forked from benbarnett/raphael-svg-buildjson
loop through the 'paper' variable from Raphael JS and build up the JSON object describing all images and paths within it.
// loop through the 'paper' variable from Raphael JS and build up the JSON object describing all images and paths within it.
buildJSON = function(paper) {
var svgdata = [];
svgdata.push({
width: 390,
height: 400
});
$.each(paper,
@giorrrgio
giorrrgio / gist:3129752
Created July 17, 2012 14:34 — forked from chanon/gist:661597
Facebook iframe Canvas App Authentication in node.js
var querystring = require("querystring");
var base64ToString = function(str) {
return (new Buffer(str || "", "base64")).toString("ascii");
};
var base64UrlToString = function(str) {
return base64ToString( base64UrlToBase64(str) );
};