Skip to content

Instantly share code, notes, and snippets.

@mlopezr
mlopezr / Node-RED-Sandstorm.md
Created August 9, 2016 14:26
Node-RED packaged for Sandstorm.io

Node-RED packaged for Sandstorm.io

Limitations

Sandstorm security model restricts outgoing and incoming connections. A hack exists to proxy connections, but the 'powerbox' feature will soon enable applications to selectively request the user authorization to perform such connections.

In the described setup this is not implemented. Therefore, only Node-RED interactions without a network are possible.

Prerequisites

@mlopezr
mlopezr / cryptpad-dockerfile
Created October 5, 2016 12:16
Dockerfile for cryptpad that works behind port forwarding
FROM node:6
# Should run as non-root user but currently can't make it to work behind a reverse proxy. Alternatives are:
# 1) Change source to show a different websocket port than the one listened: https://github.com/xwiki-labs/cryptpad/issues/42
# 2) Tweak reverse proxy to rewrite GET /api/config responses
# 3) Expose server on port 80 within Docker container <-- simplest approach selected
# Create directories
RUN mkdir /data \
&& mkdir -p /usr/src/app \

Keybase proof

I hereby claim:

  • I am mlopezr on github.
  • I am mariolr (https://keybase.io/mariolr) on keybase.
  • I have a public key whose fingerprint is 350A ECC7 9149 45E6 8757 04A0 8353 BB07 494E 7074

To claim this, I am signing this object:

@mlopezr
mlopezr / README.md
Last active November 19, 2017 10:04
Scrape Alexa Skills Kit Documentation to eBook
@mlopezr
mlopezr / full-response-with-commands.json
Last active January 18, 2019 10:40
Sample Spoken Horizontal List
{
"directives": [
{
"type": "Alexa.Presentation.APL.RenderDocument",
"token": "intro",
"document": {
"type": "APL",
"version": "1.0",
"theme": "dark",
"import": [],
@mlopezr
mlopezr / zapier-matrix.js
Created September 6, 2016 23:52
Zapier script to integrate with matrix.org chatrooms
'use strict';
var Zap = {
get_session_info: function(bundle) {
/*
Argument:
bundle.request.url: <string>
bundle.request.headers: <object>
bundle.request.params: <object> # this will be mapped into the querystring
@mlopezr
mlopezr / server.js
Last active March 13, 2019 21:52
Sample server to run Alexa skill on your machine, to be used with ngrok
const express = require('express');
const bodyParser = require('body-parser');
const handler = require('./index').handler;
function CreateHandler(handler) {
return (req, res) => {
handler(req.body, null, (err, result) => {
if (err) {
return res.status(500).send(err);
@mlopezr
mlopezr / README.md
Last active March 14, 2019 14:11
Running Alexa skills from your local machine

Running Alexa skills from your local machine

Talk to Alexa skills running on your local machine. Stop waiting for Lambda deployments. Debug step-by-step.

Setup

  • Find the index.js file containing your ASK SDK NodeJS skill handler code (usually in skill-name/lambda/custom)
  • Add server.js to the same folder where index.js is located
@mlopezr
mlopezr / terraform-fiware-lab.tf
Created September 10, 2015 16:12
Simple example of using terraform.io to provision on FIWARE Lab Cloud a VM instance with a public IP and firewalling rules
### Variables ###
# Variables can be set by exporting environment variable TF_VAR_varname
variable keypair {
description = "SSH keypair to be used for VM authentication. The keypair should already be registered in FIWARE Lab Cloud."
}
variable image_id {
default = "7f2b4b3e-1cda-4e16-a09a-a97c600f78c0"
@mlopezr
mlopezr / Sample question component for quiz skill using APL.md
Last active August 2, 2019 13:12
Sample APL for quiz skill: pager with result of last question and next question

Sample question component for quiz skill using APL

This is a sample APL for a quiz result and question.

It includes both the APL document and sample data sources.

Tweak it