Instantly share code, notes, and snippets.

View checkout_starter.js
purchase_order = {
'type': 'purchase_order' ,
'secure_hash': '7a7375b0bb9752796214919af4aacdcd830434c17174d621a802240865e816ad',
'pr_data': {
"merchant_id": "9a8e58eae43d01fd162d3c879f264d4d",
"currency": "USD",
"amount_cents": 123123,
"shipping_cents": 12,
"order_items": [{
"title": "Stack of Paper"
View input-placeholder.js
/* JS fallback for HTML5 placeholder
* requires jQuery and Modernizr (to detect support)
* by Jon Raasch - @jonraasch - http://jonraasch.com/
* modified script from Nico Hagenburger: http://bit.ly/LgrkT0
*/
if(!Modernizr.input.placeholder){
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
View parseQuerystring.jquery.js
jQuery.extend({
parseQuerystring: function(){
var nvpair = {};
var qs = window.location.search.replace('?', '');
var pairs = qs.split('&');
$.each(pairs, function(i, v){
var pair = v.split('=');
nvpair[pair[0]] = pair[1];
});
return nvpair;
View modified-x-axis-intervals-and-labels.js
//based on the source of http://g.raphaeljs.com/linechart.html
var options = {
axis: "0 0 1 1", // Where to put the labels (trbl)
axisxstep: 16 // How many x interval labels to render (axisystep does the same for the y axis)
};
document.addEventListener('DOMContentLoaded', function () {
// Make the raphael object