Skip to content

Instantly share code, notes, and snippets.

View asifvora's full-sized avatar
🇮🇳
Life is Journey Not a Destination.

Asif Vora asifvora

🇮🇳
Life is Journey Not a Destination.
View GitHub Profile
@asifvora
asifvora / instagram-follow-script.js
Last active August 31, 2021 09:15
Async/Await Essentials for Production: Loops
const timeoutPromise = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));
const list = document.querySelectorAll('.L3NKy');
function clikOnLink(link){
link.click();
}
const asyncLoop = async () => {
for (let i = 0; i < list.length ; i++) {
await timeoutPromise(1000);
@asifvora
asifvora / grouped by dates
Created January 4, 2019 12:59
grouped by dates
groupedDates(dates) {
let groupedDates = dates.reduce((l, r) => {
let date = r.OppEvents.DueDate;
let parseDate = new Date(Date.parse(date));
let d = parseDate;
let dd = d.getDate();
let mm = d.getMonth() + 1; //January is 0!
let yyyy = d.getFullYear();
var key = yyyy + dd + mm;
if (typeof l[key] === "undefined") {
@asifvora
asifvora / api models Locations.js
Created November 29, 2017 07:52 — forked from juanpasolano/api models Locations.js
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[