Axel Rauschmayer (also on 🦣)
@dr-axel.de
• JavaScript, TypeScript, web development
• Blog: https://2ality.com
My main account is on Mastodon (you can follow via RSS): https://fosstodon.org/@rauschma
• Blog: https://2ality.com
My main account is on Mastodon (you can follow via RSS): https://fosstodon.org/@rauschma
Reposted by Axel Rauschmayer (also on 🦣)
Useful whenever you declare a variable just for an `if` statement. That variable should be “inside” the statement but is at the same level.
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
November 10, 2025 at 9:30 PM
Useful whenever you declare a variable just for an `if` statement. That variable should be “inside” the statement but is at the same level.
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
Useful whenever you declare a variable just for an `if` statement. That variable should be “inside” the statement but is at the same level.
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
November 10, 2025 at 9:30 PM
Useful whenever you declare a variable just for an `if` statement. That variable should be “inside” the statement but is at the same level.
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
Comes up regularly in my JS code. I loved having this feature when I wrote Go code—e.g. (stmt+expr!):
if match, _ := re.FindStringMatch(str); match != nil {…}
2/ Downsides:
A. More complicated file system structure
B. Two URLs for same file
A. More complicated file system structure
B. Two URLs for same file
November 10, 2025 at 6:27 AM
2/ Downsides:
A. More complicated file system structure
B. Two URLs for same file
A. More complicated file system structure
B. Two URLs for same file
I’m not sure but it must be.
November 9, 2025 at 8:53 PM
I’m not sure but it must be.
Ah, wait! They are a multimap for servers because those receive both HttpOnly cookies and session cookies.
November 9, 2025 at 7:26 PM
Ah, wait! They are a multimap for servers because those receive both HttpOnly cookies and session cookies.
Query strings yes! But cookies?
> document.cookie = 'k=v1; k=v2'
> document.cookie
"k=v1"
> document.cookie = 'k=v1; k=v2'
> document.cookie
"k=v1"
November 9, 2025 at 4:51 PM
Query strings yes! But cookies?
> document.cookie = 'k=v1; k=v2'
> document.cookie
"k=v1"
> document.cookie = 'k=v1; k=v2'
> document.cookie
"k=v1"
They do make this feature less important than it once was but are complementary IMO:
• If a heading has an ID then a heading self-link goes to that ID.
• Otherwise, a text fragment link is used.
Even with text fragment links I still often use the heading self-links on GitHub, Wikipedia, my blog, …
• If a heading has an ID then a heading self-link goes to that ID.
• Otherwise, a text fragment link is used.
Even with text fragment links I still often use the heading self-links on GitHub, Wikipedia, my blog, …
November 8, 2025 at 9:35 PM
They do make this feature less important than it once was but are complementary IMO:
• If a heading has an ID then a heading self-link goes to that ID.
• Otherwise, a text fragment link is used.
Even with text fragment links I still often use the heading self-links on GitHub, Wikipedia, my blog, …
• If a heading has an ID then a heading self-link goes to that ID.
• Otherwise, a text fragment link is used.
Even with text fragment links I still often use the heading self-links on GitHub, Wikipedia, my blog, …
Example: GitHub adds a little paragraph “icon” to each heading that you can click in order to link to the heading. That is something browsers could do. I wrote a bookmarklet with that functionality and use it surprisingly often.
November 8, 2025 at 4:26 AM
Example: GitHub adds a little paragraph “icon” to each heading that you can click in order to link to the heading. That is something browsers could do. I wrote a bookmarklet with that functionality and use it surprisingly often.
Reposted by Axel Rauschmayer (also on 🦣)
Three website features that could be built into browsers:
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
November 6, 2025 at 11:55 PM
Three website features that could be built into browsers:
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
Three website features that could be built into browsers:
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
November 6, 2025 at 11:55 PM
Three website features that could be built into browsers:
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
• Mode toggles (dark mode, light mode, print mode, …)
• Self-links for headings
• Cookie dialogs (with a default choice that can be triggered automatically)
I’m still making up my mind but I think I don’t want the font size to change depending on how large the viewport is.
November 6, 2025 at 6:22 PM
I’m still making up my mind but I think I don’t want the font size to change depending on how large the viewport is.
Some insights:
• Helpful: “Please Don't Use JSON Web Tokens for Browser Sessions” by Ian London. ianlondon.github.io/posts/dont-u...
• By default, fetch() sends *and* receives cookies—which means you can use it to log in if session tokens are stored in HTTP-only cookies.
• Helpful: “Please Don't Use JSON Web Tokens for Browser Sessions” by Ian London. ianlondon.github.io/posts/dont-u...
• By default, fetch() sends *and* receives cookies—which means you can use it to log in if session tokens are stored in HTTP-only cookies.
Ian's Projects Blog
ianlondon.github.io
November 5, 2025 at 9:47 PM
Some insights:
• Helpful: “Please Don't Use JSON Web Tokens for Browser Sessions” by Ian London. ianlondon.github.io/posts/dont-u...
• By default, fetch() sends *and* receives cookies—which means you can use it to log in if session tokens are stored in HTTP-only cookies.
• Helpful: “Please Don't Use JSON Web Tokens for Browser Sessions” by Ian London. ianlondon.github.io/posts/dont-u...
• By default, fetch() sends *and* receives cookies—which means you can use it to log in if session tokens are stored in HTTP-only cookies.
Good question! I don’t know.
November 3, 2025 at 9:44 PM
Good question! I don’t know.