Skip to content

Instantly share code, notes, and snippets.

View anish2690's full-sized avatar

Anish George anish2690

View GitHub Profile
@anish2690
anish2690 / firestore_cursor.js
Created September 22, 2021 05:36 — forked from navidshad/firestore_cursor.js
Read all data from Firestore by a cursor and resolve the Bandwidth Exhausted error
/*
How can we read all data from a firestore collection?
HI guys I want to show you how.
I had these problems for reading all data from a firestore collection:
1. firestore cursor is not proper as a powerful cursor as to be able make this task done.
2. after few thousands request you will get Bandwidth Exhausted error.
For doing this task we need two things and each one can helps us resolve above problems:
1. A powerfull cursor
@anish2690
anish2690 / docker-destroy-all.sh
Created May 15, 2020 04:31 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@anish2690
anish2690 / js.js
Created November 8, 2019 18:30 — forked from capfsb/js.js
js.js
var recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition)();
recognition.lang = 'en-US';
recognition.interimResults = false;
recognition.maxAlternatives = 5;
recognition.start();
recognition.onresult = function(event) {
console.log('You said: ', event);
};
@anish2690
anish2690 / memorySizeOfObject.js
Created November 8, 2019 18:23
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':