Skip to content

Instantly share code, notes, and snippets.

View chrissrogers's full-sized avatar
🐠

Christopher Rogers chrissrogers

🐠
View GitHub Profile
// If using PayPal through Braintree, instantiate the PayPal class as follows
var paypal = recurly.PayPal({ braintree: { clientAuthorization: MY_CLIENT_AUTHORIZATION_CODE } });
// handle errors
paypal.on('error', function (err) {
// err.code
// err.message
// [err.error]
});
@chrissrogers
chrissrogers / change.js
Created October 23, 2014 20:35
updating and dispatching a change event
function changeZip () {
var input = document.querySelector('#postal_code');
input.value = '90210';
input.dispatchEvent(new Event('change'));
}
@chrissrogers
chrissrogers / recurly-js-ajax.js
Created July 10, 2014 19:05
recurly-js + ajax
$('form').on('submit', function (event) {
var form = this;
event.preventDefault();
recurly.token(form, function (err, token) {
if (err) {
// handle error using err.code and err.fields
} else {
$.ajax({
url: '/registrations/something',
data: {
@chrissrogers
chrissrogers / example.html
Last active October 30, 2015 05:12
recurly.token
<form id="payment-info" action="/submit-payment">
<input type="text" data-recurly="number">
<input type="text" data-recurly="cvv">
<input type="text" data-recurly="month">
<input type="text" data-recurly="year">
<input type="text" data-recurly="first_name">
<input type="text" data-recurly="last_name">
<input type="text" data-recurly="address1">
<input type="text" data-recurly="address2">
@chrissrogers
chrissrogers / ted.md
Last active January 3, 2016 15:19
TED talks exercise

Display current TED Talk videos in a slideshow

The purpose of this exercise is to create a HTML/CSS/Javascript application that allows users to page through the latest TED Talks. There are a couple requirements:

  • the application must be a single page application that uses no server side components
  • for each page, you should display:
    • picture
    • description
    • link to the video
  • only one page should be visible at once
@chrissrogers
chrissrogers / gist:5816252
Last active November 11, 2017 23:31 — forked from db48x/gist:5816073
en:
faker:
address:
city_prefix: [North, East, West, South, New, Lake, Port]
city_suffix: [town, ton, land, ville, berg, burgh, borough, bury, view, port, mouth, stad, furt, chester, mouth, fort, haven, side, shire]
building_number: ['#####', '####', '###']
street_suffix: [Alley, Avenue, Branch, Bridge, Brook, Brooks, Burg, Burgs, Bypass, Camp, Canyon, Cape, Causeway, Center, Centers, Circle, Circles, Cliff, Cliffs, Club, Common, Corner, Corners, Course, Court, Courts, Cove, Coves, Creek, Crescent, Crest, Crossing, Crossroad, Curve, Dale, Dam, Divide, Drive, Drive, Drives, Estate, Estates, Expressway, Extension, Extensions, Fall, Falls, Ferry, Field, Fields, Flat, Flats, Ford, Fords, Forest, Forge, Forges, Fork, Forks, Fort, Freeway, Garden, Gardens, Gateway, Glen, Glens, Green, Greens, Grove, Groves, Harbor, Harbors, Haven, Heights, Highway, Hill, Hills, Hollow, Inlet, Inlet, Island, Island, Islands, Islands, Isle, Isle, Junction, Junctions, Key, Keys, Knoll, Knolls, Lake, Lakes