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.
Latest tips / 2
Find the gitignore rule that excludes a file from 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
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":
Search & replace with RegEx groups in VS Code
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!
Let VoiceOver on iOS read a split element as a single element with the text role
VoiceOver on iOS reads each element individually when a user swipes across the screen. If an element like a link is composed of several span elements, VoiceOver will not read the entire link text but only the text of the active span element (the one that the user has swiped on). Buttons are an exception - VoiceOver will read all child elements at once.
For cases where you want VoiceOver to read the whole text at once you can use the unofficial role text
which causes VoiceOver to read the split element as one element. Note that this role is not an official role but just used by VoiceOver. In addition, the role should not be placed on the a
tag directly but on a child element because it would overwrite the implicit link
role of the a
tag.
<a href="https://tinytip.co">
<!-- Let VoiceOver on iOS read the entire link text at once -->
<span role="text">
<span>tinytip</span>
<span class="material-icons" aria-label="(external)">open_in_new</span>
</span>
</a>