Skip to content

Instantly share code, notes, and snippets.

@darul75
darul75 / Google_oAuth.js
Created January 15, 2019 17:28 — forked from entaq/Google_oAuth.js
Google oAuth 2.0 sample
/**
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) {
@darul75
darul75 / async.js
Created March 14, 2019 22:03 — forked from bschwartz757/async.js
Async/await function to fetch data from multiple URLs in parallel
/* 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()
#!/usr/bin/ruby
require 'stripe'
Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
# Maximum allowed
PAGE_SIZE = 100
# Displaying charge info
def display_charges_info(data)
@darul75
darul75 / stripe_invalid_request.cs
Last active April 14, 2021 20:07
stripe_invalid_request.cs
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()
@darul75
darul75 / stripe_webhook.js
Last active April 14, 2021 20:24
stripe_webhook.js
const app = require('express')();
/*
Instructions:
1) run your node server
--command to run--
> node stripe_webhook.js
@darul75
darul75 / backend.py
Last active April 15, 2021 07:18
stripe_flask_charge
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...."
@darul75
darul75 / middleware_gin_v2.go
Last active April 8, 2024 23:31
Clerk Go SDK : Gin Web Framework middleware
package clerk
import (
"errors"
"net"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"