Skip to content

Instantly share code, notes, and snippets.

View abdus's full-sized avatar

Abdus abdus

View GitHub Profile
const countDownTimer = (totalTime) => {
let timeFunc = setInterval(() => {
console.log(totalTime);
totalTime--;
if (totalTime < 0) {
clearInterval(timeFunc);
console.log("Time's Up!");
}
}, 1000)
}
// function for validating parameter
const validateParam = (param2validate) => {
if (!param2validate) return false;
if (param2validate.length === 0) return false;
if (typeof param2validate != 'string') return false;
};
const searchPhrase = (phrase, data) => {
if (validateParam(phrase) === false){
{
"short_name": "Abdus",
"name": "Abdus",
"icon": [
{
"src": "/pwa/img/icons-192.png",
"type": "image/png",
"sizes": "192x192"
},
{
@abdus
abdus / mp4toGIF.sh
Last active December 9, 2018 14:06
this script accept a mp4 file path as an arg and convert it to GIF and stores in the same dir
#!/bin/bash
if [ ! -d ./frames ]
then
mkdir frames
fi
ffmpeg -i $1 -r 20 'frames/frame-%03d.jpg'
cd frames
convert -delay 5 -loop 0 *.jpg $1.gif
const fetch = require('node-fetch')
const { execSync } = require('child_process')
async function getRepoURLs(user) {
let gh_data = await fetch(`https://api.github.com/users/${user}/repos`)
gh_data = await gh_data.json()
return gh_data
}
async function main() {
@abdus
abdus / mode.js
Created August 3, 2019 14:14
get the most frequent element from an array. In other words, mode of an array
/**
* Getting the most frequent element from an array
*/
function mode(array = []) {
// check if it is an array and have atleast a single element
if (!Array.isArray(array)) {
throw new Error(`Please provide an array as argument`);
}
@abdus
abdus / linkedin-auto-invite.js
Last active September 3, 2019 03:22
Simple script for sending mass invite on linkedin #automation #auto-invite
// ++++++++++++++++++++++++++++++++++++++++++++++++++++
// script for sending auto invite to people in linkedin
// ++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Simple script for sending mass invite on linkedin
// NOTE: This will send invite to the profiles available in your 'RECOMANDATION' tab
//
//
//
// HOW TO
@abdus
abdus / secure-email-static-site.html
Created November 7, 2019 08:33
Sending Encrypted Emails from Front-End/Static Sites
<html>
<body>
<form action="">
<input
type="email"
id="email"
name="email"
placeholder="mail@abdus.xyz"
/>
<br />
#!/usr/bin/env bash
REPO=artistic
UPLOAD_INSTRUCTIONS="Upload your creation to GitHub!
# 1. Create a new empty repo on your GitHub account
# 2. Upload your repository using the instructions on https://github.com/new, or this script!"
git init $REPO
cd $REPO
touch README.md