This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function() { | |
var PAYPAL_SCRIPT = 'https://www.paypalobjects.com/api/checkout.js'; | |
var ATTEMPTS = 3; | |
function loadPayPalCheckout(callback) { | |
ATTEMPTS -= 1; | |
var container = document.body || document.head; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"en_AD", | |
"fr_AD", | |
"es_AD", | |
"zh_AD", | |
"en_AE", | |
"fr_AE", | |
"es_AE", | |
"zh_AE", | |
"ar_AE", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<script src="https://www.paypalobjects.com/api/checkout.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/ScrollMagic.min.js"></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<script src="https://www.paypalobjects.com/api/checkout.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/ScrollMagic.min.js"></script> | |
</head> | |
<body> | |
<div id="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const request = require('request-promise'); | |
const ENV = 'sandbox'; | |
const CLIENT_ID = 'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Write a `until(condition, finalCallback)` function that calls the `condition` function until the result is truthy, then calls the final callback | |
function waitUntilUserLoggedIn() { | |
until(function(callback) { | |
ajax('/api/user', function(err, user) { | |
if (err) { | |
callback(err); | |
} else { | |
callback(null, user.is_logged_in ? true : false) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPerson(name) { | |
let result = ajax('/api/person/' + name); | |
return result.person; | |
} | |
function getPersonDateOfBirth(name) { | |
let person = getPerson(name); | |
return person.dob; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Create a web form with a text box and a button. When the button is pressed, it should output a base64 encoded version of the text onto the page | |
// 2. Implement Array::map() | |
// 3. Implement Array::forEach() | |
// 4. Create a web form with a text field and a button. I should be able to enter a new word, press the button, and it should add my word to the page and keep all of the words that have been added in alphabetical order. | |
// 5. Create a 3x3 grid on the page and let me click on each grid element. This should toggle each square between black and white. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a form with: | |
// * A text field for a credit card number | |
// * A button to submit the credit card | |
// | |
// Requirements: | |
// | |
// - The page should do some client side validation, and only allow credit card numbers which are: | |
// * 16 digits long |