Skip to content

Instantly share code, notes, and snippets.


Abdus abdus

View GitHub Profile
abdus / tsconfig.json
Created May 14, 2021
My Default TSConfig
View tsconfig.json
"compilerOptions": {
"target": "es5",
"lib": [
"allowJs": true,
"skipLibCheck": true,
abdus / index.html
Created Mar 19, 2021
WebRTC Example (Web, Plain JavaScript)
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<title>WebRTC Practice</title>
abdus / AbortController-in-action.js
Created Jul 27, 2020
An example of how to implement AbortController in a function which returns Promise.
View AbortController-in-action.js
/* this function would return a Promise
* which would resolve with value `hello`
* after 4s
function abortTask({ signal }) {
return new Promise((resolve, reject) => {
// 1. check if it's already aborted
if (signal && signal.aborted) {
return reject(new DOMException('`signal` is in `aborted` state', 'ABORT_ERR'));
#!/usr/bin/env bash
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, or this script!"
git init $REPO
cd $REPO
# Stage and Commit Every Unsaved changes
# and push them to master
git add .
git commit -m 'comitted from deploy script'
git push origin master
# generate a clean build
bundle exec jekyll clean
abdus / secure-email-static-site.html
Created Nov 7, 2019
Sending Encrypted Emails from Front-End/Static Sites
View secure-email-static-site.html
<form action="">
<br />

Keybase proof

I hereby claim:

  • I am thisisabdus on github.
  • I am thisisabdus ( on keybase.
  • I have a public key ASB_kPwE-z_xjwIZDSBLGdmLBJfhKYUpuSm6EM6qRD4CMwo

To claim this, I am signing this object:

abdus / mode.js
Created Aug 3, 2019
get the most frequent element from an array. In other words, mode of an array
View mode.js
* 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`);