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
| function delayed(){ | |
| return new Promise((resolve, reject)=>{ | |
| setTimeout(()=>resolve("1 sec passed"), 1000) | |
| }) | |
| } | |
| //delayed().then(res=>console.log(res)) | |
| async function syncAwaits(){ | |
| var label = "delay"; |
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
| #!/usr/bin/env bash | |
| # We require two arguments: folder to search and word | |
| ocurrences=$(find $1 -type f -exec grep -io $2 {} \; | wc -l) | |
| if [ "$ocurrences" -gt 0 ];then | |
| echo "more than 0: $ocurrences" | |
| else | |
| echo "No ocurrences: $ocurrences" | |
| fi |