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
@0xAliRaza
0xAliRaza / logging.ini
Last active August 19, 2024 05:56
Local wordpress setup with Docker Compose
; log PHP errors to a file. E_ALL=32767
log_errors = on
error_reporting = 32767
error_log = /proc/1/fd/1
/**
*
* Date: 08/03/2022
* Task-06: Get second largest number from array
* Author: Ali Raza ([email protected])
*
*/
/**
*
@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 ([email protected])
*
*/
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
}