(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| package clerk | |
| import ( | |
| "errors" | |
| "net" | |
| "net/http" | |
| "net/url" | |
| "regexp" | |
| "strconv" | |
| "strings" |
| from flask import Flask | |
| from flask import render_template | |
| from flask import request | |
| from flask import json | |
| from flask import jsonify | |
| import stripe | |
| app = Flask(__name__) | |
| PUBLISHABLE_KEY = "pk_test...." |
| const app = require('express')(); | |
| /* | |
| Instructions: | |
| 1) run your node server | |
| --command to run-- | |
| > node stripe_webhook.js |
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using System.Web; | |
| using Newtonsoft.Json; | |
| using System.Web.Mvc; | |
| public class Program | |
| { | |
| public static void Main() |
| #!/usr/bin/ruby | |
| require 'stripe' | |
| Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' | |
| # Maximum allowed | |
| PAGE_SIZE = 100 | |
| # Displaying charge info | |
| def display_charges_info(data) |
| /* Client side, works in Chrome 55 and Firefox 52 without transpilation */ | |
| //https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/ | |
| async function fetchURLs() { | |
| try { | |
| // Promise.all() lets us coalesce multiple promises into a single super-promise | |
| var data = await Promise.all([ | |
| /* Alternatively store each in an array */ | |
| // var [x, y, z] = await Promise.all([ | |
| // parse results as json; fetch data response has several reader methods available: | |
| //.arrayBuffer() |
| /** | |
| reference - | |
| https://developers.google.com/accounts/docs/OAuth2WebServer | |
| https://code.google.com/apis/console/ | |
| https://developers.google.com/+/api/latest/ | |
| **/ | |
| ////handle all requests here | |
| function doGet(e) { |
| FetchImageAsBlob('https://gist.github.com/fluidicon.png', function(err, img) { | |
| if (err) { | |
| console.log(err); | |
| return; | |
| } | |
| // play with img | |
| }); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Example Data | |
| var CARS = [ | |
| {name: "Ferrari FF", horsepower: 660, dollar_value: 700000, in_stock: true}, | |
| {name: "Spyker C12 Zagato", horsepower: 650, dollar_value: 648000, in_stock: false}, | |
| {name: "Jaguar XKR-S", horsepower: 550, dollar_value: 132000, in_stock: false}, | |
| {name: "Audi R8", horsepower: 525, dollar_value: 114200, in_stock: false}, | |
| {name: "Aston Martin One-77", horsepower: 750, dollar_value: 1850000, in_stock: true}, | |
| {name: "Pagani Huayra", horsepower: 700, dollar_value: 1300000, in_stock: false} | |
| ]; |