Skip to content

Instantly share code, notes, and snippets.

View 0xAliRaza's full-sized avatar
🏠
Working from home

Ali Raza 0xAliRaza

🏠
Working from home
View GitHub Profile
/**
*
* Date: 08/03/2022
* Task-06: Get second largest number from array
* Author: Ali Raza (ali.dev@pk.see.biz)
*
*/
/**
*
@0xAliRaza
0xAliRaza / print-table
Last active March 8, 2022 13:54
Print math table of given parameter in JS
/**
*
* Date: 08/03/2022
* Task: 04
* Author: Ali Raza (ali.dev@pk.see.biz)
*
*/
function printTable(num) {
@0xAliRaza
0xAliRaza / js-array-methods
Last active March 8, 2022 13:48
Demonstration of some common js array methods.
/* JavaScript Array Methods */
let emojis;
function resetEmojis() {
emojis = ["one", "two", "three", "four"];
}
/**
*
* @param {Object} firstObj
* @param {Object} secondObj
* @return {Boolean}
*/
function checkIfEqualObjects(firstObj, secondObj) {
// Find the keys and their values in both of the objects
const firstArr = Object.entries(firstObj),
secondArr = Object.entries(secondObj);
@0xAliRaza
0xAliRaza / nginx-server-block-generator.sh
Created September 24, 2020 21:34
A handy shell script to create Nginx server-block (virtual host).
#!/usr/bin/env bash
#
# Nginx - new server block
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() {
echo -e '\e[1;31m'$1'\e[m'
exit 1
}