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 / 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 / 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
@abdus
abdus / share.html
Created March 18, 2019 13:07
Jekyll Site Social Share Buttons
<div id="share">
<a
href="https://www.facebook.com/sharer/sharer.php?u={{
page.url | absolute_url
}}"
target="_blank"
><i style="color: #44609c" class="fab fa-facebook-f"></i
></a>
<a
href="http://www.reddit.com/submit?url={{
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 / 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="[email protected]"
/>
<br />