Skip to content

Instantly share code, notes, and snippets.

View caffo's full-sized avatar

Rodrigo Franco caffo

View GitHub Profile
(function($) {
$.fn.gistify = function() {
return this.each(function() {
var link = $(this);
var href = $(this).attr('href');
var gist_id = /http:\/\/gist\.github\.com\/(\d+)/.exec(href);
if (gist_id) {
link.wrap('<div id="embedded-gist-'+gist_id[1]+'">');
@caffo
caffo / new_json_response.json
Created August 17, 2011 18:05
new_json_response.json
{
"coupon":
{
"start_date":"2011-08-04T16:46:02-04:00",
"name":"25% off",
"created_at":"2011-08-04T16:46:02-04:00",
"code":"25OFF",
"updated_at":"2011-08-04T16:46:02-04:00",
"id":9,
"percentage":25,
@caffo
caffo / update.json
Created August 17, 2011 18:06
update.json
{
"coupon" :{
"end_date": "nil"
}
}
@caffo
caffo / update_response.json
Created August 17, 2011 18:10
update_response.json
{
"coupon":
{
"start_date":"2011-08-04T16:46:02-04:00",
"name":"25% off",
"created_at":"2011-08-04T16:46:02-04:00",
"code":"25OFF",
"updated_at":"2011-08-04T17:47:02-04:00",
"id":9,
"percentage":25,
@caffo
caffo / validation_not_found_response.json
Created August 17, 2011 18:15
validation_not_found_response.json
{
["Coupon code could not be found."]
}
@caffo
caffo / validation_expired_response.json
Created August 17, 2011 18:20
validation_expired_response.json
{
["That coupon offer has expired."]
}
@caffo
caffo / validation_not_active_response.json
Created August 17, 2011 18:27
validation_not_active_response.json
{
["That coupon is no longer active."]
}
@caffo
caffo / usage_response.json
Created August 17, 2011 18:42
usage_response.json
[
{
"signups":3,
"savings":10.0,
"revenue":100.0,
"name":"product #1",
"id":8
},
{
"signups":0,
@caffo
caffo / create_subscription_using_coupon.json
Created August 17, 2011 18:50
create_subscription_using_coupon.json
{"subscription":{
"product_handle":"my-product",
"customer_attributes":{
"first_name":"Joe",
"last_name":"Blow",
"email":"[email protected]"
},
"credit_card_attributes":{
"full_number":"1",
"expiration_month":"10",
@caffo
caffo / adding_coupon_to_subscription_error.json
Created August 17, 2011 18:58
adding_coupon_to_subscription_error.json
{
[["subscription","A coupon is already associated with this subscription."]]
}