Skip to content

Instantly share code, notes, and snippets.

View scr2em's full-sized avatar

Mohamed Abdelgwad scr2em

  • Egypt
View GitHub Profile
@scr2em
scr2em / lab3-this.js
Last active August 9, 2023 18:35
JS Lab 3 - ASAT 2023
function checkThis() {
return this;
}
console.log(checkThis()); // ?
// ---------------------------------------
var obj = {
prop: "hello",
getProp: function() {
@scr2em
scr2em / lab3-hoisting.js
Last active August 9, 2023 12:37
JS Lab 3 - ASAT 2023
console.log(a); // ?
var a = 5;
// ---------------------------------------
console.log(typeof c); // ?
var c = 'hoist me';
// ---------------------------------------
@scr2em
scr2em / lab3-closure.js
Last active August 9, 2023 12:30
JS Lab 3 - ASAT 2023
function outer() {
var a = 10;
function inner() {
console.log(a);
}
return inner;
}
const x = outer();
x(); // ?
@scr2em
scr2em / built-in methods exercises
Created August 5, 2023 17:00
for ITI summer training 2023
// The toFixed function should convert a number to a string, keeping only the specified number of decimal places
function toFixed(num, precision) {
// your code here
}
console.assert(toFixed(2.1234, 1) === "2.1", "toFixed test 1 failed");
console.assert(toFixed(3.5678, 2) === "3.57", "toFixed test 2 failed");
console.assert(toFixed(0.7890, 3) === "0.789", "toFixed test 3 failed");
// The charAt function should return the character at the specified index in a string
function charAt(str, index) {

Hey there!

I'm Mohamed!

When I started learning programming (to automate some tasks), I fell in love immediately. That feeling reminds me of a famous quote by Drew Houston

"It’s like harpooning a whale. The good news is, you’ve harpooned a whale. And the bad news is, you’ve harpooned a whale!"

Anyone can learn progarmming, but can they cope up with new technologies or make them ? benefit their community ? make people's lives easier ? that's the real questions. 👀

@scr2em
scr2em / commentPicker.js
Last active January 12, 2021 21:24
Facebook random comment picker
// open the post in a new tap
var commentPicker= function(){
var comments =[];
document.querySelectorAll("li div div div div div div div div div div a").forEach(x=>{
try{
var link = x.href
if(link.match('profile.php')){
link = link.split("&")[0]
@scr2em
scr2em / remove-all-liked-videos-youtube.md
Last active August 28, 2023 07:44
How to remove all liked videos from youtube

After you open Liked Videos as a playlsit, Type in console... var items = $('body').getElementsByClassName("style-scope ytd-menu-renderer"); for(var i = 0; i < items.length; i++){ items[i].click(); }

@scr2em
scr2em / Batch-convert-webp-to-png.md
Created November 21, 2020 16:54
convert bulk of files from webp to png
@scr2em
scr2em / open-cmder-here.md
Created November 21, 2020 16:47
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
    @="Open Cmder Here"
 "Icon"="\"%CMDER_ROOT%\\icons\\cmder.ico\",0"