Skip to content

Commit

Permalink
Update TIL listing
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 3, 2024
1 parent b595d57 commit 642f0c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

This is a collection of short notes of the things I have learned on a daily basis while working on different technologies. I share these notes as I [learn in public](https://www.learninpublic.org/).

_**111** TILs and counting..._
_**112** TILs and counting..._

- 2024-01-03: [TypeScript: ElementRef for React.useRef](https://github.com/petermekhaeil/til/blob/master/./learnings/ts-react-elementref.md)
- 2024-01-02: [Null is a billion-dollar mistake](https://github.com/petermekhaeil/til/blob/master/./learnings/null-billion-dollar-mistake.md)
- 2024-01-01: [TypeScript: exactOptionalPropertyTypes](https://github.com/petermekhaeil/til/blob/master/./learnings/ts-exact-optional-property-types.md)
- 2023-12-27: [Use Zod to validate File input](https://github.com/petermekhaeil/til/blob/master/./learnings/zod-validate-file.md)
Expand Down
6 changes: 6 additions & 0 deletions feed.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"content": "# TypeScript: ElementRef for React.useRef\n\nYou can extract the type from a `useRef` hook using `ElementRef`:\n\n```tsx\nimport { useRef, ElementRef } from \"react\";\n \nconst Component = () => {\n const audioRef = useRef<ElementRef<\"audio\">>(null);\n// ^? React.RefObject<HTMLAudioElement>\n\n return <audio ref={audioRef}>Hello</audio>;\n};\n```\n\nRead [Matt Pocock's Strongly Type useRef with ElementRef](https://www.totaltypescript.com/strongly-type-useref-with-elementref).",
"date": "2024-01-03",
"path": "ts-react-elementref.md",
"title": "TypeScript: ElementRef for React.useRef"
},
{
"content": "# Null is a billion-dollar mistake\n\nIn 2009, Tony Hoare describes his invention as a \"billion-dollar mistake\":\n\n> I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.\n\n## Reading\n\n- https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/\n- https://en.wikipedia.org/wiki/Null_pointer\n- https://en.wikipedia.org/wiki/Tony_Hoare\n- https://maximilianocontieri.com/null-the-billion-dollar-mistake",
"date": "2024-01-02",
Expand Down

0 comments on commit 642f0c8

Please sign in to comment.