Skip to content

Instantly share code, notes, and snippets.

View pkarthikr's full-sized avatar

Karthik Ragubathy pkarthikr

View GitHub Profile
@pkarthikr
pkarthikr / index.js
Created December 8, 2021 09:25
Capturing Skill Event Handler
const SkillEventHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return (
request.type === 'AlexaSkillEvent.SkillPermissionAccepted' ||
request.type === 'AlexaSkillEvent.SkillPermissionChanged');
},
async handle(handlerInput) {
const userID = handlerInput.requestEnvelope.context.System.user.userId;
let acceptedPermissions;
@pkarthikr
pkarthikr / index.js
Created April 17, 2020 14:09
Day 5 - Alexa Skills Summer Camp
// 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 skillData = require('skillData.js');
const persistenceAdapter = require('ask-sdk-s3-persistence-adapter');
const gameOn = require('./gameOn.js');
const LaunchRequestHandler = {
canHandle(handlerInput) {
@pkarthikr
pkarthikr / gameOn.js
Created April 16, 2020 11:44
Day 4 - Alexa Skills Summer Camp
/*
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
const sdk = require('@alexa-games/skills-gameon-sdk');
const settings = require('./settings.js');
@pkarthikr
pkarthikr / en-IN.json
Created April 15, 2020 14:16
Day 3 - Alexa Skills Camp
{
"interactionModel": {
"languageModel": {
"invocationName": "riddle me today",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
{
"interactionModel": {
"languageModel": {
"invocationName": "riddle me today",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
// 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 data = [
'A year on Mercury is just 88 days long.',
'Despite being farther from the Sun, Venus experiences higher temperatures than Mercury.',
'On Mars, the Sun appears about half the size as it does on Earth.',
'Jupiter has the shortest day of all the planets.',
'The Sun is an almost perfect sphere.',
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills
* nodejs skill development kit.
* This sample supports multiple lauguages. (en-US, en-GB, de-DE).
* The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
* as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-fact
**/
@pkarthikr
pkarthikr / index.js
Last active August 4, 2019 17:25
CatIntent
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const GetNewFactHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest';
},
@pkarthikr
pkarthikr / index.js
Created January 25, 2019 17:17
Implementing Fulfillments and Webhooks in Dialogflow
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
// for Dialogflow fulfillment library docs, samples, and to report issues
'use strict';
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
@pkarthikr
pkarthikr / lazygit.sh
Created September 30, 2018 12:03
Lazy Git
function lazygit() {
git add .
git commit -a -m "$1"
git push
}