257 private links
Set options for an input field. Here some demo :)
UTF-8 is an encoding. Encoding is how we store code points [of Unicode] in memory.
The simplest possible encoding for Unicode is UTF-32. It simply stores code points as 32-bit integers.
UTF-8 is a variable-length encoding. A code point might be encoded as a sequence of one to four bytes. One or more code points can build a character.
Side effects of UTF-8:
- You CAN’T determine the length of the string by counting bytes.
- You CAN’T randomly jump into the middle of the string and start reading.
- You CAN’T get a substring by cutting at arbitrary byte offsets. You might cut off part of the character.
If you want a character comparison, you should be iterating on "extended grapheme clusters", or graphemes. A grapheme is a minimally distinctive writing unit in the context of a particular writing system. ö is one grapheme. é is one too. And 각.
Is Unicode hard only because of emojis?
No, for example, ö (German) is a single character, but multiple code points (U+006F U+0308).What is 🤦🏼♂️ length?
It depends of the encoding used: 5 for Python, 7 for JavaScript / Java / C#, and 17 in Rust. That’s what extended grapheme clusters are all about what humans perceive as a single character. And in this case, 🤦🏼♂️ is undoubtedly a single character.Before comparing strings or searching for a substring, normalize!
Because code points can be in different order for a grapheme. Also we want to be able to search for 2 in 𝕏².
Unicode is locale-dependent, because two grapheme with the same code points can look different in two languages.
So no, you can’t convert string to lowercase without knowing what language that string is written in. [...] I live in the US/UK, should I even care?
Yes.
What are surrogate pairs?
Unicode decided to allocate some of these 65,536 characters to encode higher code points, essentially converting fixed-width UCS-2 into variable-width UTF-16.
A surrogate pair is two UTF-16 units used to encode a single Unicode code point. For example, D83D DCA9 (two 16-bit units) encodes one code point, U+1F4A9.
The top 6 bits in surrogate pairs are used for the mask, leaving 2×10 free bits to spare: 1101 10?? ???? ???? to 1101 11?? ???? ????'
Is UTF-16 still alive?
Yes. The only downside of UTF-16 is that everything else is UTF-8, so it requires conversion every time a string is read from the network or from disks.
A good docker image boilerplate
How typescript types can improve safety?
The seventh version supports timestamps in them. What a cool thing, because they are now sortable, and searchable. Time slices will be easy :)
Le guide d'Orange contenant un certain nombre de ressources
Examples of relevant class names.
A consistent set of design tokens already defined
A great guide on the modulo operator :)
The summary/details pattern is the best way to hide and show content.
Why is there the first rule of ARIA? Because ->
It is interesting as it avoids a typescript to javascript compilation.
It works with plain JS too.
A set of resources to use fluid typography instead of media queries
A template engine for HTML. It allows to build custom expression.
It is used by #FoundryVTT
Add snippets to get statistics from Core Web Vitals
A color gamut is a dimension in which we define colors, and the color space defines how we define a color inside the gamut.
For example, sRGB is a color gamut that spans a range of colors, and Hex, RGB and HSL are the spaces available to explore the gamut.
and the sRGB gamut becomes inconvenient:
- The technology allows better colors (at least a wider gamut than allowed by sRGB)
- Dead grey zones between two points in space.
- inconsistent levels of lightness
So two units have landed. One is oklch:
- l controls the lightness, and measured in a range of 0% to 100%
- c is the chroma value, measured in decimals between 0 and 0.37
- h is the same old hue of HSL, in the same range of 0deg to 360deg
/ a
is the alpha in the oklch.
The chroma limit value could be infinite, but P3 Iphone display and sRGB are limited to 0.37.
“Chroma refers to the purity of a color. A hue with high chroma has no black, white, or gray added to it. Conversely, adding white, black, or gray reduces its chroma. It’s similar to saturation but not quite the same. Chroma can be thought of as the brightness of a color in comparison to white.” — Cameron Chapman
Similar to microdata.
Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. Instead of throwing away what works today, microformats intend to solve simpler problems first by adapting to current behaviors and usage patterns. - https://microformats.org/wiki/about
What is the difference between microformats and microdata? It seems that microdata is an extension of microformats. Also microdata is meant for HTML5, whereas microformats is meant for everything.
How to make an accessible skeleton with ARIA ?
Note that the skeleton pattern hides a bad design where the UI is slower than expected. So avoid it as much as possible.
Microdata is used to nest metadata within existing content on web pages: for example, a list of persons.
To create an item, such as a person, the itemscope
attribute is used.
To add a property to an item, the itemprop
attribute is used on one of the item's descendants.