Skip to content

Instantly share code, notes, and snippets.

View goldzulu's full-sized avatar

Goldzulu goldzulu

View GitHub Profile
@goldzulu
goldzulu / htmlToText.js
Created May 4, 2020 11:14
Convert HTML to Text (Javascript)
// CONVERT HTML TO TEXT
var returnText = htmlSource;
//-- remove BR tags and replace them with line break
returnText=returnText.replace(/<br>/gi, "\n");
returnText=returnText.replace(/<br\s\/>/gi, "\n");
returnText=returnText.replace(/<br\/>/gi, "\n");
//-- remove P and A tags but preserve what's inside of them
returnText=returnText.replace(/<p.*>/gi, "\n");
returnText=returnText.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1)");
//-- remove all inside SCRIPT and STYLE tags
@goldzulu
goldzulu / git-clearHistory
Created May 19, 2020 09:40 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@goldzulu
goldzulu / changeAskToAskX.js
Last active May 21, 2020 10:41
Scripts to help update the latest ask-cli, change it to be called askx and then install the package (locally) for those of you using method 2 https://gist.github.com/germanviscuso/48f5c68f876b31b51ba59f91b49a253f
const fs = require('fs');
const fileName = './package.json';
let file = require(fileName);
console.log(file.name);
if (file.name == "ask-cli") {
file.name="ask-cli-x";
console.log("Changed name ask-cli to name ask-cli-x");
}
@goldzulu
goldzulu / m.sh
Created June 11, 2020 11:48
A utility shell script to deploy only the Interaction Model skill package to the Alexa Developer Console.
#/bin/bash
# Written Originally by @VoiceTechGuy1 - GOLDZULU 2020-06-11
# Update the remote ADC Interaction Model with the locale ones
# Need to be located at the root of the alexa skill sdk project
# Please modify as needed to customize for your own needs
# Do not use it as is!
# use the get-skill-id.js file to get the skill id for the current alexa skill project
# check the blog at https://dzone.com/articles/syncing-local-alexa-skills-json-files-with-alexa-d
@goldzulu
goldzulu / get-skill-id.js
Last active June 12, 2020 19:51
Get Alexa Skill Skill ID from command line suitable for both Ask Cli > 2.x and Ask Cli 1.x originally by Justin Jeffress @SleepyDeveloper
const fs = require('fs');
const path = require('path');
const CONFIG_FILE = '.ask/ask-states.json';
const CONFIG_FILE_V1 = '.ask/config';
// Break the path into an array of folders and filter out
// the empty entry for the leading '/'
const folders = process.env.PWD.split('/').filter(Boolean);
@goldzulu
goldzulu / GoldzuluTextAPL.json
Created July 27, 2020 22:51
An APL 1.4 example on how to use fonts and text (AVG) VectorGraphics Component in Alexa Skill
{
"type": "APL",
"version": "1.4",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {
@goldzulu
goldzulu / grid sequence.json
Created July 30, 2020 20:09
Sample APL 1.4 GridSequence With Embedded Video
{
"type": "APL",
"version": "1.4",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {},
@goldzulu
goldzulu / Alexa-Grid-List.json
Created July 30, 2020 20:24
Alexa Grid List Sequence
{
"document": {
"type": "APL",
"version": "1.4",
"theme": "dark",
"import": [
{
"name": "alexa-layouts",
"version": "1.2.0"
}
{
"type": "APL",
"version": "1.4",
"settings": {},
"theme": "dark",
"import": [],
"resources": [],
"styles": {},
"onMount": [],
"graphics": {},
@goldzulu
goldzulu / ask-states.json
Created September 17, 2020 15:54
To reset the skill place ask-states.json in the .ask folder and skill.json to the skill-package folder. Running ask deploy after will recreate all the infrastructure again
{
"askcliStatesVersion": "2020-03-31",
"profiles": {
"ddm": {
"skillId": "",
"skillInfrastructure": {
"@ask-cli/lambda-deployer": {
"deployState": {}
}
}