Skip to content

Instantly share code, notes, and snippets.

@enricop89
enricop89 / app.js
Created May 29, 2019 08:46
Nexmo SMS Set DLR Webhook
const Nexmo = require( 'nexmo' );
const apiKey = "yourApiKey";
const apiSecret = "yourApiSecret";
const nexmo = new Nexmo( {
apiKey,
apiSecret,
} );
nexmo.message.sendSms('Nexmo test','440000000', 'Your message', {callback: 'https://enrico.com/status/adjni3'},
function (err, res ){
@enricop89
enricop89 / App.js
Last active June 10, 2019 16:45
RN Example App for OT Network Test
import React, { Component } from 'react';
import { Text, SafeAreaView, View } from 'react-native';
import { OTSession, OTPublisher, OTSubscriber, OT } from 'opentok-react-native';
import {VideoStats} from './networkTestHelper';
export default class App extends Component {
constructor( props ) {
super( props );
this.apiKey = '';
this.sessionId = '';
@enricop89
enricop89 / MainActivity.java
Created June 24, 2019 14:34
Basic VIdeo App - Disconnect Error
package com.tokbox.android.tutorials.basic_video_chat;
import android.opengl.GLSurfaceView;
import android.support.v7.app.AppCompatActivity;
import android.support.annotation.NonNull;
import android.Manifest;
import android.os.Bundle;
import android.util.Log;
import android.widget.FrameLayout;
import android.app.AlertDialog;
@enricop89
enricop89 / launch.json
Last active June 25, 2019 21:00
Debug js using VSCode
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Hello Function",
"program": "${workspaceFolder}/node_modules/.bin/sls",
"args": ["invoke", "local", "-f", "hello", "--data", "{}"],
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
@enricop89
enricop89 / tsconfig.json
Created June 26, 2019 06:13
ts config for aws lambda
{
"compilerOptions": {
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": ".build" /* Redirect output structure to the directory. */,
"strict": true /* Enable all strict type-checking options. */,
"rootDir": "./" /* List of root folders whose combined content represents the structure of the project at runtime. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
}
@enricop89
enricop89 / App.js
Created September 18, 2019 11:08
Example of Connecting/Disconnecting OTRN
import React, { Component } from 'react';
import { View, Button } from 'react-native';
import { OTSession, OTPublisher, OTSubscriber } from 'opentok-react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
show: false
}
@enricop89
enricop89 / index.html
Last active September 27, 2019 12:35
Opentok with RequireJS
<!-- index.html -->
<html>
<body>
<!-- container for rendered React element -->
<div id="root"></div>
<!-- Require.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.2/require.min.js"></script>
<!-- main -->
@enricop89
enricop89 / response.json
Created March 5, 2020 17:45
Vonage AI - Sample NLU Response
"nluResponse": {
"debug": null,
"input": "hi",
"result": {
"action": "welcome",
"intent_on_hold": "",
"completion_attempts": 0,
"contexts": [],
"dialog_complete": true,
"intent": "welcome message",
@enricop89
enricop89 / App.js
Created March 23, 2020 08:49
React-native - Example of proxyURL
import React, { Component } from 'react';
import { View } from 'react-native';
import { OTSession, OTPublisher, OTSubscriber } from 'opentok-react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.apiKey = '';
this.sessionId = '';
this.token = '';
@enricop89
enricop89 / nginx.conf
Last active March 31, 2020 14:12
Nginx Proxy Configuration
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.