Skip to content

Instantly share code, notes, and snippets.

@tkhatibi
tkhatibi / generateNationalCode.php
Last active February 6, 2020 14:22 — forked from Alireza2n/nationalCodeGenerator.py
تولید کننده کد ملی در پی‌اچ‌پی
function generateNationalCode()
{
$numbers = [];
$sum = 0;
foreach(array_reverse(range(2, 10)) as $i) {
$j = rand(0, 9);
$numbers[] = $j;
$sum += $j * $i;
}
$m = $sum % 11;
@tkhatibi
tkhatibi / post_install.sh
Created May 18, 2019 11:43 — forked from waleedahmad/post_install.sh
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
/**
* @param {number|string} value
* @returns {string}
*/
const getPrintableElement = (value) => value + " ";
/**
* @param {number} day
* @returns {string}
*/