Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

German Viscuso germanviscuso

🏠
Working from home
  • Amazon
  • Madrid
Block or report user

Report or block germanviscuso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@germanviscuso
germanviscuso / TwoASK-CLIs.md
Last active Jun 2, 2020
Use old and new ASK-CLIs in parallel (Alexa Skills Kit Command Line Interface)
View TwoASK-CLIs.md

I advise that if the VSCode plugin supports the ask-cli v2 then use Method 1. If we're not there yet then use Method 2 if you want the VSCode plugin to work. If you don't care about the plugin just go with Method 1.

Method 1

After following these instructions the old ask-cli v1.7.23 will run via the command ask1 and the latest ask-cli v2 via the command ask. You will be able to update the ask-cli v2 as usual. You can skip all steps below to create the npm package by just doing:

View TermsOfUse
General
This Terms of Use are an agreement between you (the "user") and German Viscuso (“us” or “we”). Before using any of our Alexa Skills (“our skills”), please read this agreement and our Alexa Skills Privacy Policy as well as the Alexa Terms of Use by the Amazon Digital Services LLC (with its affiliates, “Amazon”).
Regarding Amazon, “Alexa” means their Alexa Voice Service which includes third party services (like our skills) and other related Software.
If you use one of our skills you fully agree to this Terms of Use.
Disclaimer
View PrivacyPolicy
This privacy policy describes how German Viscuso (“us” or “we”) protects your (“you”, “the user”) privacy and your data. Before using any of our Alexa Skills (“our skills”), please read this policy and our Alexa Skills Terms of Use, as well as the Alexa Terms of Use and the Privacy Policies by the Amazon Digital Services LLC (with its affiliates, “Amazon”).
Regarding Amazon, “Alexa” means their Alexa Voice Service which includes third party services (like our skills) and other related Software.
If you use one of our skills you fully agree to this privacy policy.
General
@germanviscuso
germanviscuso / example-query.js
Created Apr 4, 2020 — forked from thetrevorharmon/example-query.js
Query JSON with S3 Select in Node.js
View example-query.js
// See tth.im/s3json for a full explanation of this code
const AWS = require('aws-sdk');
const S3 = new AWS.S3();
exports.handler = async (_, context) => {
try {
const query = 'SELECT * FROM s3object[*].results[*] r;';
// test query is against data from https://swapi.co/api/planets/?page=2
@germanviscuso
germanviscuso / index.js
Last active Feb 24, 2020
Quick code to support an intent that plays long form audio in an Alexa skill
View index.js
var stream = {
"token": "my_token", // no auth token, you decide what this is
"url": 'https://my_song.mp3',
"metadata" : {
"title": "My Song Title",
"subtitle": "My Song Subtitle",
"art": {
"sources": [
{
"contentDescription": "image",
@germanviscuso
germanviscuso / index.js
Last active Feb 24, 2020
Example on how to user personId as primary key in an Alexa Persistence adapter
View index.js
function getPersistenceAdapter() {
// This function is an indirect way to detect if this is part of an Alexa-Hosted skill
function isAlexaHosted() {
return !!process.env.S3_PERSISTENCE_BUCKET;
if (isAlexaHosted()) {
const {S3PersistenceAdapter} = require('ask-sdk-s3-persistence-adapter');
return new S3PersistenceAdapter({
bucketName: process.env.S3_PERSISTENCE_BUCKET,
objectKeyGenerator: keyGenerator
@germanviscuso
germanviscuso / gist:26f3f96d9048c5446acc6e4cfe8009d6
Created Jan 13, 2020
Overwrite existing git repo with another one
View gist:26f3f96d9048c5446acc6e4cfe8009d6
(Switch to old repo)
> git remote add new-origin new_repo_url
> git remote update
> git push -f new-origin master --follow-tags (WARNING: new repo gets overwritten!)
@germanviscuso
germanviscuso / es-ES.json
Last active Dec 31, 2019
Technovation Workshop (Advanced Fact - es-ES)
View es-ES.json
{
"interactionModel": {
"languageModel": {
"invocationName": "curiosidades espaciales",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
View index.js
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
},
handle(handlerInput) {
@germanviscuso
germanviscuso / gist:3f6f24644905d272ea3778b729bbf5e2
Created Aug 21, 2019
Personal AWS resources in Alexa Hosted Skills
View gist:3f6f24644905d272ea3778b729bbf5e2
How do I set up an Alexa-hosted skill to use resources on a personal AWS account?
With the AWS Lambda execution role ARN, you can seamlessly use resources on a personal AWS account to expand the functionality of your Alexa-hosted skill. For example, you can connect the Alexa-hosted skill to an Amazon DynamoDB table. Take the following steps to set up your Alexa-hosted skill to use resources on a personal AWS account:
In the Alexa developer console, open your Alexa-hosted skill, and then in the code editor click the icon that has hover text AWS Lambda Role Execution ARN. Copy the ARN.
If you have not done so already, on your personal AWS account, in the Identity and Access Management (IAM) dashboard, create a role that allows access to the resource that you want your Alexa-hosted skill to access.
In the IAM dashboard, click Roles, click the name of the role you want to edit, and then click the Trust relationships tab.
Edit the trust relationship to include the sts:AssumeRole action, and specify the AWS Lambda
You can’t perform that action at this time.