Skip to content

Instantly share code, notes, and snippets.

View armonge's full-sized avatar
🏠

Andrés Reyes Monge armonge

🏠
View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
set -o xtrace
if [ ! -f "dialogflow_key.json" ] && [ "${DIALOGFLOW_KEY:-}" ]; then
echo "$DIALOGFLOW_KEY" >dialogflow_key.json
fi
if [ -f "dialogflow_key.json" ]; then
gcloud auth activate-service-account --key-file=dialogflow_key.json
@armonge
armonge / deploy-alexa.sh
Last active April 4, 2019 07:34
voxa-cli
#!/usr/bin/env bash
set -euo pipefail
# set -o xtrace
if [ ! -d "$HOME/.ask" ]; then
# Create the .ask directory
mkdir ~/.ask
# Create ASK config
sed -e s/ASK_ACCESS_TOKEN/"${ASK_ACCESS_TOKEN}"/g -e \
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armonge
armonge / Dialogflow Translation strings.ipynb
Last active December 19, 2018 00:10
Count the words in all different phrases of a Dialogflow agent
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"intents": [
{
"intent": "LaunchIntent"
},
{
"intent": "AMAZON.NoIntent"
},
{
"intent": "SumIntent",
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# open new tabs in same directory
source /etc/profile.d/vte.sh
A = 3200
B = 1800
C = 1920
D = 1080
E = 2
F = 2
values = {
from django.http import StreamingHttpResponse
from django.conf import settings
import subprocess
def _backup():
db_config = settings.DATABASES['default']
db_config['HOST'] = db_config.get('HOST') or 'localhost'
db_config['PORT'] = db_config.get('PORT') or 3306
@armonge
armonge / futures_pi.py
Created September 11, 2014 05:55
Calculating PI with Python
import functools
import random
import math
from concurrent import futures
def map_d(c):
return math.hypot(random.random(), random.random())
import requests
from concurrent import futures
from faker import Factory
import functools
from collections import namedtuple
fake = Factory.create()
url = 'http://www.solucionescamelot.com/index.php/contactenos'
DataTuple = namedtuple('DataTuple', ['email', 'name'])