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
| // ----------------------------------------------------- | |
| // --------------- DESTRUCTERING --------------- | |
| // ----------------------------------------------------- | |
| // ------- NON-NESTED ARRAYS --------------- | |
| // Simple Destructering | |
| function foo() { | |
| return [1, 2, 3] | |
| } |
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
| // ES 6 Arrow Function vs Function | |
| // showcases the difference between the static binding of the `this context` | |
| // with ES 6 Arrow Function and dynamic binding with normal Functions | |
| var obj = { | |
| dynamicBinding() { | |
| console.log('Dynamic Context: ', this) | |
| window.setTimeout(function() { | |
| console.log('T Dynamic Context: ', this), | |
| 0 |
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
| PS1="🐑💨 \W doka$ " | |
| # --------- GIT compleition ---------- | |
| if [ -f ~/.git-completion.bash ]; then | |
| . ~/.git-completion.bash | |
| fi | |
| # --------------- PYTHON --------------- | |
| # Setting PATH for Python 3.6 | |
| # The original version is saved in .bash_profile.pysave |
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
| # Implemented and tested on MacOS | |
| # Add utilties to ~./bash_profile to make them usable in your terminal | |
| # ------------------- PORT UTILTIES ---------------------- | |
| # Find PID of process on a specific port | |
| # param portNumber | |
| # example: "findPortProcess 8080" | |
| findPortProcess() { | |
| portProcess="$(lsof -n -i4TCP:$1 | grep LISTEN)" | |
| if [ "$portProcess" ] |
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
| /** | |
| * Microtask Queue vs Task Queue | |
| * Prioritisation between Microtask Queue (also named Job Queue) and Task Queue | |
| * | |
| * There are two queues for executing asynchronous javascript. The Micro Task queue has priority over the Task Queue. | |
| * If you would keep on filling the micro task queue, you would block the code on the task queue. | |
| * Asynchronous code which returns objects (like promises) are getting added to the Micro Task Queue. | |
| * Asynchronous code which leave no trace (like setTimeout()) are getting added to the Task Queue. | |
| */ |
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
| // A simple Bookmarklet which calculates the time you have worked at a given day | |
| // 1. Go to https://zeitplan.hcweb.ch | |
| // 2. Log in and select the day you want to evaluate | |
| // 3. Click on the Bookmarklet you created with the code below | |
| // To pulish, first minify / uglify it before you throw it into the book | |
| // marklet create: | |
| // 1. Uglify https://skalman.github.io/UglifyJS-online/ | |
| // 2. Bokkmarkify: https://mrcoles.com/bookmarklet/ |
NewerOlder