Skip to content

Instantly share code, notes, and snippets.

View tejasmob's full-sized avatar
🏠
Working from home (Remote Developer)

Tejas Suthar tejasmob

🏠
Working from home (Remote Developer)
  • Mobiquity Inc.
  • Ahmedabad
View GitHub Profile
@marcelobern
marcelobern / smapi token.md
Created September 4, 2018 05:00
Alexa SMAPI access token (Login with Amazon)

Before invoking SMAPI operations, it is necessary to obtain an access token from Login with Amazon to authenticate your request.

If you intend to use node-alexa-smapi you will need to retreive a refresh token, so here are a few ways to retrieve an initial refresh token:

Option 1 use ask util generate-lwa-tokens (for more information see: https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html#util-command)

Option 2 use Postman to create an auth request and retrieve a token: 1- Under authorization select Type "OAuth 2.0" and click on "Get New Access Token". 2- Complete the form with the following data:

  • grant type: autorization code

npm vs yarn

What you need to know

npm install === yarn

Install is the default behavior.

npm install taco --save === yarn add taco

@kndt84
kndt84 / authorize.js
Last active May 17, 2024 03:11
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;
@frankV
frankV / .dockerignore
Created December 22, 2015 06:06
Dockerfile for an Ionic Framework Project
Dockerfile
config.xml
.sass-cache
.editorconfig
.io-config.json
.dockerignore
hooks/
platforms/
node_modules/
{
".123" : "application/vnd.lotus-1-2-3",
".3dml" : "text/vnd.in3d.3dml",
".3g2" : "video/3gpp2",
".3gp" : "video/3gpp",
".a" : "application/octet-stream",
".aab" : "application/x-authorware-bin",
".aac" : "audio/x-aac",
".aam" : "application/x-authorware-map",
".aas" : "application/x-authorware-seg",