Skip to content
tinytip

Learn something new in 30 seconds tinytip is a growing collection of tiny tips for frontend developers

Latest tips

Find previous commands in the terminal

January 19, 2023
#terminal

When you want to rerun a previously executed command in the terminal, you can use the up and down arrow keys to navigate through the history of commands. If you want to search for a specific command, press Ctrl + R and start typing. The terminal will search through the history and show you the latest matching command. Press Ctrl + R again to search for older commands.

Create QR codes in Chrome to send URLs to your smartphone

January 19, 2023
#chrome

If you want to open a website on your smartphone, i.e. to test it on a mobile device, you can use the sharing feature of Chrome to create a QR code that you can scan with your smartphone. Click on the share icon in the address bar and select "Create QR Code". Then scan the QR code with the camera app of your smartphone to open the website.

Generate QR code in Chrome

Find the gitignore rule that excludes a file from git

October 27, 2022
#git

When a file is ignored by git you can use the check-ignore command which shows you why the file is ignored. This is useful if you have multiple .gitignore files or some complex patterns in your rules.

git check-ignore -v path/to/a/file.png

Empty Cache and Hard Reload in Chrome

October 27, 2022
#devtools #chrome

We all know cache invalidation is hard. If you experience some cache problems while working on a web project in Chrome you can empty the cache and do a hard reload. Just open the DevTools, right click (or long press) on the reload icon in the toolbar and choose "Empty Cache and Hard Reload":

Empty cache and Hard Reload in Chrome

Search & replace with RegEx groups in VS Code

September 22, 2022
#vscode

The search & replace feature in VS Code cannot just search for static strings but accepts RegEx patterns. Just click on the .* icon in the search input to enable RegEx search.

For the replace pattern you can reference a RegEx group by using "$" and the index of the group. $0 references the entire match, $1 references the first group, $2 the second group and so on.

Let's make an example: The search pattern Hello (\S+) will find strings like "Hello John". The group (\S+) captures the name (here "John") which can be referenced in the replace pattern using $1. With the replace pattern Hi $1! we'll get the following results:

- Hello John
+ Hi John!

- Hello Jane
+ Hi Jane!