Thunderbird chrome not working

If even after adding chrome folder thuderbird doesn’t use your cutomized css, you should try with:

Settings/Options > Advanced > General > Config Editor

toolkit.legacyUserProfileCustomizations.stylesheets > true

center (v and h) an expanded element

It is not easy to center vertically and horizontally an expanded element in a page.

I found this code working for me:

.expansible {max-width: 10vw; 
    transition: all 1s; 
    transition:transform 0.25s ease;}
.expanded {
    max-width: 20vw;
    transform:scale(2.6);
    position: absolute;
    left: 30%;
    top: 25%;
    outline:0;
}    

The image is expended with this js code (put at the end of a file):

document.querySelectorAll('img.expansible').forEach(imageElement => {
  imageElement.addEventListener('click', e => {
    e.preventDefault()
    imageElement.classList.toggle('expanded')
  })
})

and adding the class expansible to the images you want expansible.

problems with an external hard disk

You could have problems with an external hard disk, such as safely removing it (even after unmounting it). In this case you could try this code:

sudo hdparm -Y /dev/[your device: something like sde1 or sdh1]

Another problem could be the impossibility to mount your external hd. In this case, if the hd has an ntfs filesystem, you could try this code:

sudo ntfsfix /dev/[your device]

I found this last code on www.makeuseof.com.

How to hide an empty element

with css

To hide an element you can use css: element:empty (such as p:empty) {display:none}, or img[src=""] {display:none}.

with mysql code

You can, even with PDO, use this syntax

if ($data[0]['somecolumn'] != '') {echo " " . $data[0]['somecolumn'] . "";}

how to merge video files

Two ways:

1) via terminal

you can use this code

mkvmerge -o outfile.mkv infile_01.mp4 \+ infile_02.mp4 \+ infile_03.mp4

2) graphically

by using f.e. Avidemux:

  • open the first video file
  • go to the end of that file
  • append the second, and go to the end
  • then append all other possible video files
  • if you plan to merge several video (such as several films), you can queue instead of save (immediately) the files

ssd slow (in Linux)

If your SSD has become slow, it could depend from the swap file: f.e. in fstab the ssd swap UUID could be wrong (after some partitions changes in your SSD).

You can fix this by giving to the swap partition the correct UUID.

regex multiple replacements

You could have to replace several “whatever”, f.e. in a sql file I had to replace many columns with dates, such as ‘2005-08-15’ splitting them in ‘2005’, ’08’, ’15’.

I manage to do it with this code:

find NULL, '(.*?)-(.*?)-(.*?)', NULL, NULL, NULL
replace NULL, '\1', '\2', '\3', NULL

In this way you can replace '2005-08-15', NULL, NULL, NULL with '2005', '08', '15', NULL, and likewise all the like, such as '2012-06-23', NULL, NULL, NULL with '2012', '06', '23', NULL and so on.

But, be careful: make a backup of your file before.

another case: if you want replace several digits with the same digits formatted, you can try something like this code:

search: ^    (\d{2})$
replace: <h2>cap. \1</h2>\n

open link inside a ‘details’ element

‘Details’ html tag is a very easy way to collapse/expand a web content: you can see it in the following example. This is the code:

<details>
<summary>expansible title</summary>
<p>all the content you want: text, images, video, in a nutshell: all possible content</p>
</details>

and this is the result:

expansible title

all the content you want: text, images, video, in a nutshell: all possible content

But there is a problem: the collapsed content is not reachable unless you click over his ‘summary’ (in the example above: ‘expansible title’) . Therefore a link from outside the details content toward some element inside that, doesn’t work, because it cannot open it.

To fix this problem you can use a little javascript:

  const openDetailsIfAnchorHidden = evt => {
  const targetDIV = document.querySelector(evt.target.getAttribute("href"));
  if ( !! targetDIV.offsetHeight || targetDIV.getClientRects().length ) return;
  targetDIV.closest("details").open = true;
 }

 [...document.querySelectorAll("[href^='#']")].forEach( 
   el => el.addEventListener("click", openDetailsIfAnchorHidden )
 );

to be put at the bottom of a page (otherwise it doesn’t work).

working with LO alphabetical index

In LibreWriter the best way to create and edit an alphabetical index is to use a concordance file, in wich you can add, edit or delete entries (otherwise you can only add entries).

As “alternative entry” you can set the name actually shown in your index.