Skip to content

Instantly share code, notes, and snippets.

@ppanchal97
ppanchal97 / country-codes.json
Last active July 20, 2020 12:34
All of the countries and dialling codes supported by AWS Simple Notification Service (SNS).
[
{
"name": "Afghanistan ",
"code": "+93"
},
{
"name": "Albania ",
"code": "+355"
},
{

Segment Investigation

Initial Investigation

Introduction

  • The Segment libraries (“ Sources ”) generate messages about what’s happening in a web or native app, and send them to the Segment servers
  • Segment then translates the content of those messages into different formats for use by other tools (which we call ‘ Destinations ’), and sends the translated messages to those tools.

Suggested Tracking Process

  1. Define Business Objectives
  2. Decide what to collect
  3. Create naming conventions
@ppanchal97
ppanchal97 / verifyCognitoIDToken.js
Created August 12, 2020 20:17
Verifying a cognito ID token using a JS Lambda
// Import dependencies
const jwt = require('jsonwebtoken');
const jwkToPem = require('jwk-to-pem');
// Example data from https://cognito-idp.<REGION>.amazonaws.com/<POOL-ID>/.well-known/jwks.json
const body = {
"keys": [
{
"alg": "RS256",
"e": "AQAB",