Skip to content

Instantly share code, notes, and snippets.

View kkrishnan90's full-sized avatar

Krishna kkrishnan90

View GitHub Profile
@kkrishnan90
kkrishnan90 / Emulator from Terminal on Ubuntu
Created December 16, 2018 16:37
Run Android Emualtor from Terminal on Ubuntu using this bash script
#!/bin/bash
`#You can close the Terminal Window after running the emulator. Nohup will keep the service running` \
echo "Setting env variables..."
export ANDROID_SDK={YOUR_ANDROID_SDK_PATH_HERE}
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
echo "Starting Emulator..."
nohup emulator @{YOUR_EMULATOR_NAME_HERE} & `#get list of avd and get the exact name and replace it here with YOUR_EMULATOR_NAME_HERE` \
disown
@kkrishnan90
kkrishnan90 / Advanced Emulator Selection in Ubuntu (From Command Line)
Created December 16, 2018 17:47
Advanced Emulator Selection in Ubuntu (From Command Line)
#!/bin/bash
echo "Setting env variables..."
export ANDROID_SDK=~/Android/Sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
echo "Showing Emulator Names..."
em_list=$(emulator -list-avds)
echo "$em_list"
select em in $em_list;
do
echo "You Picked $em"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kkrishnan90
kkrishnan90 / cloudSettings
Created May 28, 2020 14:49 — forked from sarthaksavvy/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-29T09:00:59.907Z","extensionVersion":"v3.4.3"}
@kkrishnan90
kkrishnan90 / Firestore Collection
Created July 15, 2021 07:45
Nodejs (Express) script to connect to Firestore and push clickstream data via endpoints from client
const express = require("express");
const cors = require("cors");
const { Firestore } = require("@google-cloud/firestore");
const { PubSub } = require("@google-cloud/pubsub");
const firebase = require("firebase");
const bodyParser = require("body-parser");
const productsJson = require("./products.json");
const app = express();
app.use(cors());
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
const { Firestore } = require("@google-cloud/firestore");
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
process.env["GOOGLE_APPLICATION_CREDENTIALS"] = "credentials.json";
const db = new Firestore();
exports.helloWorld = functions.https.onRequest((request, response) => {
@kkrishnan90
kkrishnan90 / FirebasePhoneAuthIonicV3.md
Last active September 8, 2021 13:24
Firebase Phone Auth using Ionic V3 - Sending and reading OTP

General Steps to be followed as a flow process to complete Firebase Phone OTP Auth in Ionic V3

Step 1 : Get the phone number through input from the user. Step 2 : Pass this phone number to the firebase and receive a callback with verification ID. Step 3 : Pass on this verification ID through navParams to the next page where the user will enter the OTP sent to the entered mobile number. Step 4 : Verify the OTP that is sent with firebase for success() or failure() .

STEP 1 & 2 & 3

phone-verification.html

from flask import escape
from flask import jsonify
def hello_http(request):
request_json = request.get_json(silent=True)
request_args = request.args
if request_json and 'image' in request_json:
res = detect_handwritten_ocr_uri(request_json['image'])
else:
res = "Error in payload data. Attach image"
{
"name": "appengine-storage",
"description": "Node.js Google Cloud Storage sample for Google App Engine",
"scripts": {
"start": "node app.js",
"test": "mocha system-test/*.test.js --exit --timeout=30000"
},
"engines": {
"node": ">= 12.20.0"
},
doctype html
html(lang="en")
head
title Static Files
meta(charset='utf-8')
link(rel="stylesheet", href="/static/main.css")
body
form(method="POST", action="/upload", enctype="multipart/form-data")
input(type="file", name="file")
input(type="submit")