Skip to content

Instantly share code, notes, and snippets.

View rmtuckerphx's full-sized avatar

Mark Tucker rmtuckerphx

View GitHub Profile
@rmtuckerphx
rmtuckerphx / aws-kinesis-stream.js
Created January 26, 2023 20:30 — forked from roccomuso/aws-kinesis-stream.js
Aws Kinesis stream upload example in JS - get rtsp stream with ffmpeg and use putMedia to upload it on Amazon Kinesis
const ffmpeg = require('fluent-ffmpeg')
const parseUrl = require('url').parse
// Polyfill, modifying the global Object
require('es6-object-assign').polyfill()
global.Promise = require('es6-promise').Promise
const aws4 = require('aws4')
const axios = require('axios')
const CancelToken = axios.CancelToken
const fs = require('fs')
const PipeViewer = require('pv')
@rmtuckerphx
rmtuckerphx / AddToShoppingCart-1.json
Created May 4, 2022 21:58
Connections.StartConnection
{
"type": "Connections.StartConnection",
"uri": "connection://AMAZON.AddToShoppingCart/1",
"input": {
"products": [
{
"asin": "B01962MDHA"
}
]
},
@rmtuckerphx
rmtuckerphx / GlobalComponent.ts
Created February 12, 2022 17:05
Jovo v4 END w/ OutputTemplate
import { Component, BaseComponent, Global, Handle } from '@jovotech/framework';
import { GoodbyeOutput } from '../output/GoodbyeOutput';
@Global()
@Component()
export class GlobalComponent extends BaseComponent {
@Handle({ prioritizedOverUnhandled: true })
END() {
return this.$send(GoodbyeOutput);
@rmtuckerphx
rmtuckerphx / GlobalComponents.ts
Last active February 15, 2022 17:41
Jovo v4 RepeatIntent
import { Component, BaseComponent, Global, Handle } from '@jovotech/framework';
@Global()
@Component()
export class GlobalComponent extends BaseComponent {
@Handle({ intents: ['RepeatIntent'], prioritizedOverUnhandled: true })
RepeatPreviousMessage() {
if (this.$history.prev?.output) {
return this.$send(this.$history.prev.output);
@rmtuckerphx
rmtuckerphx / i18next-interval-array.js
Last active August 6, 2021 02:25
Using i18next with nesting, interval post processing, and array access
const i18next = require("i18next");
const intervalPlural = require("i18next-intervalplural-postprocessor");
const resources = {
en: {
translation: {
"whatCanIBuyInterval": "(0)[$t(nest0)];(1)[$t(nest1)];(2)[$t(nest2)];(3-inf)[$t(nest3)];",
"nest0": "Check back later.",
"nest1": "You should try $t(listItems1).",
"nest2": "Learn more about $t(listItems2, {'conj': 'or'}).",
{
"type": "APL",
"version": "1.7",
"layouts": {
"Overlay": {
"parameters": [
"line1",
"line2",
"line3"
],
@rmtuckerphx
rmtuckerphx / direnv-win.md
Last active July 18, 2024 15:03
Steps to install direnv on Windows

direnv on Windows

Overview

In JavaScript projects, I used to use dotenv so that I could put local environment variables in a .env file for local development. But dotenv requires you to add code to your project. With direnv, you can put local env vars in a .envrc file and those env vars are loaded automatically in the shell.

Steps to install

For these steps, it is assummed that you have installed Git Bash on Windows. I also use VSCode as my editor.

  1. Create a folder such as c:\tools to put the direnv.exe file and add it to the Windows PATH
@rmtuckerphx
rmtuckerphx / snatchword-i18next-en-US.json
Last active March 30, 2021 01:56
Example of how to structure a translation file for Jovo for cross-platform development. This is from the game, Snatch Word (snatchword.com). Instead of SSML, it uses Speech Markdown (speechmarkdown.org)
{
"translation": {
"Sounds": {
"badge_BixbyCapsule": "!['https://example.com/audio/badge.wav']",
"badge": "!['https://example.com/audio/badge.mp3']",
"find_BixbyCapsule": "!['https://example.com/audio/find1.wav']",
"find": "!['https://example.com/audio/find1.mp3']",
"renew_BixbyCapsule": "!['https://example.com/audio/renew1.wav']",
"renew": "!['https://example.com/audio/renew1.mp3']",
"snatchFail_BixbyCapsule": "!['https://example.com/audio/snatch-fail1.wav']",
import icon from 'react-icons/lib/go/radio-tower'
export default {
name: 'transmission',
title: 'Transmission',
type: 'document',
icon,
initialValue: {
activeDate: (new Date()).toISOString().split('T')[0],
message: '. verify ##code## ..',

XYZ Corp is not an authorized reseller of a global voice registry. No such registry exists. Amazon, Google, Samsung and other platforms handle their own registration of voice applications and have varying rules. For example, Amazon allows multiple developers or companies to use the same invocation name. The only way to guarantee a unique invocation name is to be able to prove that you own the intellectual property rights. In most cases, the invocation name is not reserved unless you have an active voice application that is certified and available to the public. XYZ Corp is here to help you through the process. We can create a voice app for multiple platforms and get them certified. There is no fee to register or deploy a voice app. Our fees are for consultation, app creation, hosting, and maintenance. There are advantages to getting a voice app sooner and building your brand on voice. We will clearly explain this to you. Since we are hosting your voice app, you may need to give XYZ Corp the authority to use y