This file contains 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
[ | |
{ | |
"gov": "Cairo", | |
"locations": [ | |
"15 Of May", | |
"Abbasia", | |
"Abdeen", | |
"Al Katamia", | |
"Bab El Shearia", | |
"Badr City", |
This file contains 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 wait = (ms) => new Promise((r) => setTimeout(r, ms)); | |
let count = 0; | |
async function addFriends() { | |
const boxes = document.querySelectorAll( | |
"div.rq0escxv.j83agx80.rj1gh0hx.cbu4d94t.buofh1pr.g5gj957u.ph5uu5jm.b3onmgus.e5nlhep0.ecm0bbzt.n1dktuyu" | |
); | |
for (let box of Array.from(boxes)) { | |
let mutualFriendsText = box.querySelector(".a8c37x1j .ni8dbmo4 .stjgntxs"); | |
let numberOfMutualFiends = Number( | |
mutualFriendsText?.innerText?.split(" ")[0] |
This file contains 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
let treesize = 10; | |
let counter = treesize; | |
let arr = []; | |
//tree | |
for (let i = 0; i < treesize; i++) { | |
arr.push(' '.repeat(counter) + '*'.repeat((i*2)+1)); | |
counter--; | |
} | |
//trunk |
This file contains 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
(() => { | |
console.love = msg => { | |
const css = "color:#f40e83;font-size:25px;"; | |
console.log(`%c${msg}`, css); | |
}; | |
})(); | |
console.love('Microsmsm') |
This file contains 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
/** | |
* @param {number} rows | |
* @param {number} cols | |
*/ | |
function make2DArray(rows, cols) { | |
let x = []; | |
for (let i = 0; i < rows; i++) { | |
x[i] = []; | |
for (let j = 0; j < cols; j++) { | |
x[i][j] = []; |
This file contains 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
/** | |
* @param {number[]} nums | |
* @return {number} | |
*/ | |
var firstMissingPositive = function(nums) { | |
for (var i =0; i <= nums.length; i++) { | |
if (nums.indexOf(i+1) === -1){ | |
return i+1 | |
} | |
} |
This file contains 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
/** vars **/ | |
var level = 1; | |
var score = null; // | |
var time = 3000 ; // milliseconds | |
var pause = false; | |
var lives = 3; | |
var sign = "+"; | |
var isStarted = false; | |
/** Functions **/ |