This file contains 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
package clerk | |
import ( | |
"errors" | |
"net" | |
"net/http" | |
"net/url" | |
"regexp" | |
"strconv" | |
"strings" |
This file contains 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
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...." |
This file contains 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
#!/usr/bin/ruby | |
require 'stripe' | |
Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' | |
# Maximum allowed | |
PAGE_SIZE = 100 | |
# Displaying charge info | |
def display_charges_info(data) |
This file contains 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
const app = require('express')(); | |
/* | |
Instructions: | |
1) run your node server | |
--command to run-- | |
> node stripe_webhook.js |
This file contains 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
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() |
This file contains 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
/* 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() |
This file contains 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
/** | |
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) { |
This file contains 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
FetchImageAsBlob('https://gist.github.com/fluidicon.png', function(err, img) { | |
if (err) { | |
console.log(err); | |
return; | |
} | |
// play with img | |
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
// Exercise 1 | |
//============== | |
// Refactor to remove all arguments by partially applying the function | |
var words = function(str) { | |
return _.split(' ', str); | |
}; | |
var match = R.curry(function(what, x) { | |
return x.match(what); |
NewerOlder