Skip to content

Instantly share code, notes, and snippets.

View germanviscuso's full-sized avatar
🏠
Working from home

German Viscuso germanviscuso

🏠
Working from home
View GitHub Profile
@germanviscuso
germanviscuso / sync.sh
Last active November 18, 2021 22:15
Mirror/Sync Github Organization Repos locally
#!/bin/bash
# Clone all org repos (via ssh)
curl -s https://api.github.com/orgs/<organization>/repos?per_page=200 | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["ssh_url"])'
# Later pull from each repo
back=`pwd`; for d in `find . -type d -name .git` ; do cd "$d/.."; git pull origin; cd $back ; done
@germanviscuso
germanviscuso / es-ES.json
Last active August 31, 2021 21:36
Alexa Skill Basics: Service Client API
{
"interactionModel": {
"languageModel": {
"invocationName": "datos personales",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
@germanviscuso
germanviscuso / aplcard.js
Last active November 17, 2020 17:28
Sí mi Capitán - Alexa Games workshop
const APLHomeCardRequestInterceptor = {
process(handlerInput) {
const withSimpleCard = handlerInput.responseBuilder.withSimpleCard;
const withStandardCard = handlerInput.responseBuilder.withStandardCard;
function withSimpleAPLCard(cardTitle, cardContent){
if(supportsAPL(handlerInput)){
handlerInput.responseBuilder.addDirective({
type: 'Alexa.Presentation.APL.RenderDocument',
version: '1.0',
document: APLDoc,
@germanviscuso
germanviscuso / index.js
Created November 13, 2020 11:49
Alexa Node SDK Navigation Directive
return handlerInput.responseBuilder
.speak('Starting navigation')
.addDirective({
type: 'Navigation.SetDestination',
destination: {
singleLineDisplayAddress: "Calle de San Mateo 13, 28004",
multipleLineDisplayAddress: "Calle de San Mateo 13, 28004",
name: "Museo del Romanticismo",
coordinate: {
latitudeInDegrees: 40.425860,
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
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 April 4, 2020 23:30 — forked from thetrevorharmon/example-query.js
Query JSON with S3 Select in Node.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 February 24, 2020 16:02
Quick code to support an intent that plays long form audio in an Alexa skill
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 February 24, 2020 00:01
Example on how to user personId as primary key in an Alexa Persistence adapter
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 January 13, 2020 16:55
Overwrite existing git repo with another one
(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!)