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
| ##### Some linux commands to move biggest files | |
| # Move 6 biggest files of current dir to "bigfiles" dir | |
| ls --sort=size | head -n 6 | xargs -I{} cp {} ../bigfiles | |
| # Only files with filename length of 14: |
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
| https\:\/\/(www.)?(domain.com\/?)\S*?(?=((\<br)|(\(\()| |$)) | |
| Test https://www.regextester.com/ | |
| ======== REGEX ======== | |
| \S*? | |
| - ? is Lazy operator: Match as few characters as possible | |
| (?=((\<br)|(\(\()| |$)) |
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
| find . -type f ! -iname ".gitignore" -delete | |
| find . -empty -type d -delete |
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
| # Dry run | |
| git fetch origin master | |
| git diff --name-status HEAD..origin/master | |
| # Finally merge | |
| git merge origin/master |
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
| First create or update .gitignore File locally and run | |
| `git rm --cached -r .` | |
| `git add -A` | |
| `git commit -m "Add gitignore"` | |
| `git push` | |
| Now on remote first upload the new gitfile **maually** and then run | |
| `git rm --cached -r .` |
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
| Locally: | |
| ``` | |
| git checkout oldname | |
| git branch -m "newname" | |
| git push origin :oldname newname | |
| git push origin -u newname | |
| ``` | |
| In remote: |
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
| ## Aufgabe 1 | |
| Schreibe ein JavaScript-Programm, das ein Array von ganzen Zahlen einliest (du kannst die Eingabe auch manuell direkt in den Code reinschreiben) und dann überprüft, ob eine bestimmte Zahl im Array vorhanden ist. | |
| Hinweis: includes-Funktion https://www.w3schools.com/jsref/jsref_includes_array.asp | |
| ## Aufgabe 2 | |
| Schreibe ein JavaScript-Programm, das ein Array von ganzen Zahlen und eine Zahl bekommt und dann zählt, wie oft diese Zahl im Array vorkommt. | |
| Hinweis: forEach https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach |