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 Dec 27, 2023
1 parent 766338e commit e2f670a
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/).

_**108** TILs and counting..._
_**109** TILs and counting..._

- 2023-12-27: [Use Zod to validate File input](https://github.com/petermekhaeil/til/blob/master/./learnings/zod-validate-file.md)
- 2023-12-21: [Smart App Banners](https://github.com/petermekhaeil/til/blob/master/./learnings/ios-smart-app-banners.md)
- 2023-12-18: [GPTBot is OpenAI’s web crawler ](https://github.com/petermekhaeil/til/blob/master/./learnings/ai-gptbot.md)
- 2023-12-10: [GitHub Issue Forms](https://github.com/petermekhaeil/til/blob/master/./learnings/github-issue-forms.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": "# Use Zod to validate File input\n\nYou can use [Zod](https://zod.dev/)'s `instanceof` validator to validate file inputs:\n\n```js\nconst MAX_UPLOAD_SIZE = 1024 * 1024 * 3; // 3MB\nconst ACCEPTED_FILE_TYPES = ['image/png'];\n\nconst Schema = z\n .instanceof(File)\n .optional()\n .refine((file) => {\n return !file || file.size <= MAX_UPLOAD_SIZE;\n }, 'File size must be less than 3MB')\n .refine((file) => {\n return ACCEPTED_FILE_TYPES.includes(file.type);\n }, 'File must be a PNG');\n```\n\nAbove example validates the file is the correct max file size and file type.",
"date": "2023-12-27",
"path": "zod-validate-file.md",
"title": "Use Zod to validate File input"
},
{
"content": "# Smart App Banners\n\nThe banners on top of web apps that promote the native version of the app is controlled using a `<meta>` tag in the HTML:\n\n```html\n<meta name=\"apple-itunes-app\" content=\"app-id=1477376905, app-argument=https://github.com/\" />\n```\n\nSee the [documentation on Promoting Apps with Smart App Banners\n](https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners). This only works for iOS Safari.\n\nExample from GitHub:\n\n![IMG_1477](https://github.com/petermekhaeil/til/assets/4616064/f7cf2b12-abe9-498e-9962-57fbbcd8f1c0)",
"date": "2023-12-21",
Expand Down

0 comments on commit e2f670a

Please sign in to comment.