Insidethe.com It is my space, but better than myspace

8Mar/210

RegEx To Find Lines Containing Text and Exclude Matches Containing Text

 

This is an example of how to do a find in files with PhpStorm or WebStorm but exclude lines matching a specific string.

For example, give this code below, we want to find all lines that contain the http://example.com/api but do not also contain the string 'some_variable'

$my_url = variable_get("some_variable", "http://example.com/api");
...
$my_url = 'http://example.com/api';

The RegEx pattern will find all lines that contain the URL but exclude the lines with the specified text:

^(?!.*some_variable.*$).*(http:\/\/example.com\/api)

This should work in any JetBrains editor which supports Java regular expressions.

Filed under: Programming No Comments
11Feb/210

Bookmark – GIT Remove files with wrong line endings

1) Remove every file from Git's index.

git rm --cached -r .

2) Rewrite the Git index to pick up all the new line endings.

git reset --hard

Source: https://www.xspdf.com/help/52265711.html
Filed under: bookmark No Comments
8Nov/200

Rescan For Disks Without Rebooting

for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done

Source:
https://unix.stackexchange.com/questions/404405/how-to-detect-new-hard-disk-attached-without-rebooting/500280#500280?s=a878dbdf0ffd4699bcb88957b7c1c087

Filed under: bookmark No Comments
15Jul/200

2020-07-14 Letter Pictures

 

 

2020-07-15_13-46-05

Picture of the gate with the broken gate post propped up prior to my repair

 

 

20200625_143114

Lakeshore tree on my property that was cut with a chainsaw

 

20200703_152207

Repaired gate with wire latch

Filed under: Uncategorized No Comments
17May/200

AlterGame Series by Andrew Novak

This trilogy is interesting without getting bogged down into needless details or world-building. I originally passed over this because the description and titles seemed like cheap mass-produced fiction but I found the storyline to progress quickly and remain entertaining until the end. I would like to listen to this again sometime.