for file in src/file/path/images/common-name-*
do
git mv $file $(echo $file| sed 's/\(.*\)common-name.*/\1/')other-common-name$(echo $file | sed 's/.*common-name\(.*\)/\1/')
done
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
| // positive lookahead | |
| // ?= | |
| const lookaheadRegex = /something(?=\$)/ // match something at end of line, but not the end of line | |
| // positive lookbehind | |
| // ?<= | |
| const lookaheadRegex = /(?<=\^)something/ // match something at the start of line, but not the start of line | |
| // negative lookahead | |
| // ?! |
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
| // create and fill array of given size | |
| const arrayWithNumbers = Array(4).fill(null).map((u, i) => i) [0, 1, 2, 3] | |
| // or | |
| const newArrayWithNumbers = [...Array(4)].map((u, i) => i) |
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
| # EXPORT COMMAND FIRST | |
| export COMMAND="dd if=/dev/urandom of=secret.tar.bz2 bs=56724259 count=1 conv=notrunc" | |
| # THEN | |
| for ((n=1;n<8;n++)); do eval $COMMAND; done; |
I've been in a few .php/.js-projects lately where it is not straight forward to use gf ("goto file"). Usually when the cursor in vim is above a filename I simply hit gf and it opens that file for reviewing/editing.
But in webdev land where I have been lately it is not untypically to do a reference to a file of sorts:
{% include '\_partials/main-menu' with {id: mainMenu} %}
It states the path _partials/main-menu, but the file that I want to investigate is craft/templates/_partials/main-menu.twig.
To gf my way to the right file I found that I could set path+=$PWD/craft/templates and set suffixesadd+=.twig
NewerOlder