I hereby claim:
- I am mrwanashraf on github.
- I am mrwanashraf (https://keybase.io/mrwanashraf) on keybase.
- I have a public key ASDCC-Ooqn9LMgDY6qtjCmPrpGoS87nA8Kax9dNowqKjwQo
To claim this, I am signing this object:
| ### make github detect gdscript in the languages section | |
| # navigate to path where your godot project is | |
| > 🐧Linux/Unix, MacOS | |
| echo "*.gd linguist-language=GDScript" > .gitattributes | |
| > 🪟 Windows | |
| 1- create a file named .gitattributes inside godot project |
| /* pass by value ⏳ | |
| *****************/ | |
| function hello (person) { | |
| console.log(`Hello ${person}`); | |
| } | |
| function enterName(person, name) { | |
| person = name; | |
| console.log(person); // Mundo | |
| } |
I hereby claim:
To claim this, I am signing this object:
| const array = [[1,2,[3]],4]; | |
| const flatten = (arr) => arr.toString().split(",").map( n => Number(n)); | |
| console.log(flatten(array)); |
| #!/bin/bash | |
| # 💡 Search for busy ports | |
| netstat -lnp | |
| # ✋ kill a specific port | |
| fuser -k portNumber/tcp | |
| # 💡 example | |
| fuser -k 8080/tcp |
| // unordered lists | |
| <ul> | |
| <li class="numbers">1</li> | |
| <li class="numbers">2</li> | |
| <li class="numbers">3</li> | |
| <li class="numbers">4</li> | |
| </ul> | |
| // ✅ using querySelectorAll |
| // h1 element | |
| <h1 id="hello-world">Hello World</h1> | |
| // ✅ using querySelector | |
| document.querySelector("#hello-world"); | |
| // ✅ using getElementById | |
| document.getElementById("hello-world"); |
| fn main() { | |
| // Match | |
| let mut hello_world = String::from("hello"); | |
| match hello_world.as_ref() { | |
| "hello" => hello_world.push_str(" world"), | |
| _=> hello_world.push_str("hello world") | |
| } | |
| println!("{}", hello_world); // will print hello world |
| const body = document.querySelector('body'); | |
| const helloWorldHeader = '<h1>Hello World</h1>'; | |
| // ❌ this won't work as appendChild only works with Elements not HTML | |
| body.appendChild(helloWorldHeader); | |
| // ✅ this will work as insertAdjacentHTML works very well with HTML | |
| body.insertAdjacentHTML('afterbegin', helloWorldHeader); |
| const body = document.querySelector('body'); | |
| const helloWorld = "<h1>Hello world</h1>"; | |
| // ❌ Don't use innerHTML as it messes with DOM | |
| body.innerHTML = helloWorld; | |
| // ✅ Do use insertAdjacentHTML as it goes well with DOM without messing it | |
| body.insertAdjacentHTML('afterbegin', helloWorld); |