Pure CSS ellipsis when text doesn’t fit block

If text is too long for a block on your HTML page, use this tip to truncate it with three dot ellipsis ... .myBlock { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } Note: the block's display must not be set to inline.

DS_Store files in a tar on MacOS

If you use the Terminal to create tar or zipped tar files on your Mac, then you might be aware that hidden Spotlight .DS_Store files also get sucked into the archive. To prevent this from happening, try: COPYFILE_DISABLE=1 tar <rest of tar command goes here>

How to access a DOM element in react with useRef

The useRef hook lets you assign a DOM element to a variable, which you can then interact with. In your component's JSX: <div ref={myRef}> .... </div> In your component's Javascript: const myRef = useRef(null); myRef.current.style = 'background-color: red;';

How to use git push

Push a branch to remote repo and link the local version with the remote version git push -u origin mybranch Push a branch to remote repo without triggering CI/CD pipeline (Gitlab) git push -o ci.skip