Subscriptions with stripe
Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.
![stripe's object model][stripe_object_model_diagram]
To start, create some plans.
var express = require('express'); | |
var sys = require('sys'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY"; | |
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET"; | |
function consumer() { |
<script type="text/javascript"> | |
(function() { | |
if (window.__twitterIntentHandler) return; | |
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/, | |
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes', | |
width = 550, | |
height = 420, | |
winHeight = screen.height, | |
winWidth = screen.width; |
function onFormSubmit(e) { | |
var to_email = "[email protected]"; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var spreadsheet_name = ss.getName(); | |
var sheet = ss.getSheets()[0]; | |
var columns = sheet.getRange("A1:U1").getValues()[0]; | |
var email_subject = "New response for [" + spreadsheet_name + "]"; | |
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n"; | |
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>"; |
# DEV RELOAD FOR JQUERY / UNDERSCORE | |
$ = jQuery | |
# add reloadElement to underscore | |
_.mixin | |
# reloads a particular element | |
reloadElement: (element) -> | |
if element and element.tagName | |
tag = element.tagName.toUpperCase() |
Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.
![stripe's object model][stripe_object_model_diagram]
To start, create some plans.
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
@font-face { | |
font-family: 'EntypoRegular'; | |
src: url('font/entypo.eot'); | |
src: url('font/entypo.eot?#iefix') format('embedded-opentype'), | |
url('font/entypo.woff') format('woff'), | |
url('font/entypo.ttf') format('truetype'), | |
url('font/entypo.svg#EntypoRegular') format('svg'); | |
font-weight: normal; | |
font-style: normal; | |
} |
# handle ajax events (loading and auth errors) | |
$(document).ajaxStart -> | |
settings = lines: 12, length: 6, width: 4, radius: 8, trail: 75, color: '#fff' | |
$('.loading-main').html new r.ui.spinner( settings ).spin().el | |
$('[data-section=logo]').addClass('loading') | |
$(document).ajaxStop -> | |
$('[data-section=logo]').removeClass('loading') | |
$(document).ajaxComplete (e, xhr, options) -> | |
r.errorHandler.handle(xhr) |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
CYN='\e[1;96m' | |
# git dirty branch | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "(._.)" | |
} | |
function parse_git_clean { |