Skip to content

Instantly share code, notes, and snippets.

View abhijitmehta's full-sized avatar
:electron:
Product@algolia

Abhijit Mehta abhijitmehta

:electron:
Product@algolia
View GitHub Profile
@abhijitmehta
abhijitmehta / Impala REST API From Frontend.md
Last active July 21, 2021 12:24
Example serverless function (tested on Netlify Functions) that one could call from their frontend application to retrieve results from Impala REST API

This is an example serverless function (tested on Netlify Functions) that you could call from their frontend application to retrieve results from Impala REST API.

ℹ️ Please see below, a reference architecture for one of the secure ways of calling Impala APIs(any external APIs, for that matter) from your frontend application.

❌ NEVER STORE YOUR CREDENTIALS ON CLIENT SIDE.

  • Store your credentials server side. Fetch the API response to any external API from this endpoint and then pass them to the frontend.
  • For ease, you can build a lean endpoint on any preferred serverless offerings like AWS lambda, Azure/Google/Vercel Functions
@abhijitmehta
abhijitmehta / flex_outbound_preview_Dialing.md
Last active February 27, 2021 08:44
Script for Sequence diagram to build preview dialing on Flex using Flex Action startOutboundCall and Task Creation API

Preview Dialing on Flex using Flex Action startOutboundCall and Task Creation API

Preview Dialing

Diagram Script

// Download the Node helper library from twilio.com/docs/node/install . You can do this by doing “ sudo npm install twilio -g —save "
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = process.env.TWILIO_ACCOUNT_SID;
var authToken = process.env.TWILIO_AUTH_TOKEN ;
var LookupsClient = require('twilio').LookupsClient;
var client = new LookupsClient(accountSid, authToken);
var fs = require('fs');
var readline = require('readline');
var errFileCreated='N';
@abhijitmehta
abhijitmehta / startStopMonitor.sh
Created February 28, 2017 00:32
start , stop , monitor "python app.py"
# !/bin/ksh
Init()
{
#(1) Set a work directory
WORK_DIR="$( pwd )/work"
if [ ! -d ${WORK_DIR} ]
then
// In Package Manager, run:
// Install-Package Twilio.Mvc -DependencyVersion HighestMinor
using System.Web.Mvc;
using Twilio.Mvc;
using Twilio.TwiML;
using Twilio.TwiML.Mvc;
public class VoiceController : TwilioController
{