Skip to content

Instantly share code, notes, and snippets.

wait(1500)
say "Starting to test ASR..."
result = ask "Please choose a color from red, blue or green.", {
:choices => "red, blue, green",
:recognizer => "en-PH",
:timeout => 20,
:bargein => true,
:mode => "speech",
:minConfidence => 0.6,
:onChoice => lambda { |event|
call $caller, {:callerID => 'sip:21588260@sip.tropo.net'}
say "Hello"
say "Please wait while we connect your call..."
conference "1337", {
:terminator => "*",
:playTones => true,
:onChoice => lambda { |event|
say("Disconnecting")
}}
say "goodbye"
#call $caller, {:callerID => 'sip:21588260@sip.tropo.net'}
call "9273953465", {:callerID => 'sip:21588260@sip.tropo.net'}
say "Hello! This is to inform you that we have sent a document you requested to the email you gave us. Kindly check your inbox or your spam folder for the message."
result = ask "Were you able to receive the document you requested? Press '1' for YES, or press '2' for NO.", {
:choices => "1,2",
:timeout => 10.0,
:attempts => 3,
:terminator => '#'
}
@getadeo
getadeo / dtmf.rb
Last active May 16, 2018 02:08 — forked from radralph/mads_call.rb
wait(1500)
result = ask "Please enter 3 numbers", {
:choices => "[3 DIGITS]",
:terminator => '#',
:timeout => 15.0,
:mode => "dtmf",
:onChoice => lambda { |event|
say "Thank you."
}
}
{
"title": "Leopold FC660 Capslock to FN w/ function keys and escape",
"rules": [
{
"description": "Map capslock to fn",
"manipulators": [
{
"conditions": [{ "type": "device_if", "identifiers": [{
"product_id": 257, "vendor_id": 1204
}]}],
@getadeo
getadeo / gist:c389c730262a8e8b5f2c99cdb8598bd4
Created June 28, 2017 09:50 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key

Nginx SSL Setup

  1. Generate Private Key
$ mkdir /etc/ssl/
$ cd /etc/ssl
$ openssl genrsa -out private.key 2048
  1. Generate CSR
// kills long running ops in MongoDB (taking seconds as an arg to define "long")
// attempts to be a bit safer than killing all by excluding replication related operations
// and only targeting queries as opposed to commands etc.
killLongRunningOps = function(maxSecsRunning) {
currOp = db.currentOp();
for (oper in currOp.inprog) {
op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) {
print("Killing opId: " + op.opid
@getadeo
getadeo / alembic.ini
Created March 9, 2016 14:18 — forked from spinningD20/alembic.ini
migrate include_objects problem
[excluded]
tables = ProjectInfo, AddressTypes, AddressTypes_tracking, ClientAddresses_tracking, ClientContacts, ClientContacts_tracking, ClientTypes, ClientAddresses, Clients, Clients_tracking, ContactGroups, ContactGroups_tracking, Contacts, Contacts_tracking
@getadeo
getadeo / Exclude_tables.md
Created March 9, 2016 14:06 — forked from utek/Exclude_tables.md
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

def exclude_tables_from_config(config_):
    tables_ = config_.get("tables", None)

if tables_ is not None: