This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MULTIPLIERS = [1, 2, 1, 2, 1, 2, 1, 2, 1]; | |
const isValid = (sin) => { | |
if (typeof sin !== 'string' || sin.length !== 9) { | |
return false; | |
} | |
splitedSin = sin.split('').map(Number); | |
const digits = splitedSin.reduce((allDigits, val, index) => { | |
const result = String(val * MULTIPLIERS[index]).split(''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `ls *.py` | |
do | |
echo "---> $f" | |
python3 $f > /dev/null & | |
sleep 1 | |
program=`ps -ef | grep "ython $f" | awk '{print $2}'` | |
pid=(${program}) | |
pid=${pid[0]} | |
if (($pid > 0)) |