Skip to content

Instantly share code, notes, and snippets.

View abhishekr700's full-sized avatar
🏠
Working from home

Abhishek Ranjan abhishekr700

🏠
Working from home
  • Salesforce
  • New Delhi,India
View GitHub Profile

Tools / Resources

Image Hosting:

  • Cloudiniary

HTTP Tunnel

To serve local server on a web route

  1. conda install -c conda-forge google-cloud-sdk
  2. gcloud init
  3. It will ask you to login
  4. Select project

Install Google Cloud Vision API

conda install -c conda-forge google-cloud-vision

Commands for installing packages with conda cli

Google CLoud SDK

conda install -c conda-forge google-cloud-sdk
#!/bin/bash
# Copyright (C) 2019 Abhishek Ranjan <abhishekr700@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
## Usage: ./runAllCoins.sh
## Don't continue on errors
set -e
const express = require("express");
const session = require("express-session");
const app = express();
app.use(express.json());
app.use(express.urlencoded({
extended: true

How to do work with Javascript before Form-Submit

Sometimes we may need to place checks on the input fields before the form is submiteed. One example is that you may have a re-enter passwork field and if the types passwords are not same, you may show a error message. In such cases , this is how you can do some work before the form is submitted and also avoid the submission from happening.
Source https://stackoverflow.com/questions/8133712/execute-javascript-code-straight-before-page-submit

Scheduling Tasks in Node.JS

With Persistence across server reboots

** If task deadline over while server is off, task will be executed as soon as server starts. ** Stores data in MongoDB..

Module: Mongo-Scheduler-More npmjs.com/package/mongo-scheduler-more

(This is a further developed version of Mongo-Scheduler with more features & updated dependencies.)

Usage :

Terminate an application

process.exit([code])
Ends the process with the specified code.
If omitted, exit uses the 'success' code 0.
To exit with a 'failure' code: process.exit(1);
The shell that executed node should see the exit code as 1.


Check if a file exists