├── .eslintrc.json ├── .gitattributes ├── .gitignore ├── .husky └── pre-commit ├── LICENSE.md ├── README.md ├── cache └── config.json ├── components ├── Feedback.tsx ├── Footer.tsx ├── Header.tsx ├── Hero.tsx ├── InlineLink.tsx ├── Layout.tsx ├── Meta.tsx ├── Posts.tsx ├── Prompt.tsx ├── Resource.tsx └── Socials.tsx ├── function.svg ├── next-env.d.ts ├── next-sitemap.config.js ├── next.config.mjs ├── package.json ├── pages ├── [post].tsx ├── _app.tsx ├── _document.tsx ├── about.tsx ├── api │ ├── feedback.tsx │ └── posts.tsx ├── index.tsx └── tags │ └── [tag].tsx ├── pnpm-lock.yaml ├── postcss.config.js ├── posts ├── 2022-in-review.mdx ├── a-long-journey-to-setting-up-raspberry-pi.mdx ├── building-a-pc.mdx ├── building-my-blog.mdx ├── code-readability.mdx ├── codeday-singapore-2022.mdx ├── coding-on-windows.mdx ├── epoch.mdx ├── experiencing-dolby-atmos.mdx ├── genais-introspection.mdx ├── hello-world.mdx ├── in-strive-for-perfection.mdx ├── my-front-end-stack.mdx ├── organising-my-website-repository.mdx ├── reflections-from-a-liminal-space.mdx ├── social-media.mdx ├── taking-part-in-intuition-v8.0.mdx ├── taking-part-in-polyfintech100-api-hackathon-2022.mdx ├── the-importance-of-support.mdx └── your-intranet-over-the-internet.mdx ├── public ├── arash.jpg ├── favicon.ico ├── fonts │ ├── GeneralSans-Bold.woff │ ├── GeneralSans-Bold.woff2 │ ├── GeneralSans-BoldItalic.woff │ ├── GeneralSans-BoldItalic.woff2 │ ├── GeneralSans-Medium.woff │ ├── GeneralSans-Medium.woff2 │ ├── GeneralSans-MediumItalic.woff │ ├── GeneralSans-MediumItalic.woff2 │ ├── JetBrainsMono-BoldItalic.woff │ ├── JetBrainsMono-BoldItalic.woff2 │ ├── JetBrainsMono-Medium.woff │ ├── JetBrainsMono-Medium.woff2 │ ├── JetBrainsMono-Regular.woff │ └── JetBrainsMono-Regular.woff2 ├── images │ ├── 2022-in-review │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ ├── 003.jpg │ │ └── 004.jpg │ ├── a-long-journey-to-setting-up-raspberry-pi │ │ ├── 001.jpg │ │ ├── 002.png │ │ ├── 003.png │ │ └── 004.png │ ├── building-a-pc │ │ ├── 001.jpg │ │ ├── 002.png │ │ └── 003.png │ ├── codeday-singapore-2022 │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ ├── 003.jpg │ │ ├── 004.jpg │ │ ├── 005.jpg │ │ └── 006.jpg │ ├── coding-on-windows │ │ ├── 001.png │ │ ├── 002.png │ │ └── 003.png │ ├── epoch │ │ ├── 001.jpg │ │ ├── 002.png │ │ ├── 003.png │ │ ├── 004.png │ │ ├── 005.jpg │ │ ├── 006.jpg │ │ ├── 007.jpg │ │ ├── 008.jpg │ │ ├── 009.jpg │ │ ├── 010.jpg │ │ ├── 011.jpg │ │ ├── 012.jpg │ │ ├── 013.jpg │ │ ├── 014.jpg │ │ ├── 015.jpg │ │ ├── 016.jpg │ │ ├── 017.jpg │ │ ├── 018.jpg │ │ ├── 019.jpg │ │ ├── 020.jpg │ │ ├── 021.jpg │ │ ├── 022.jpg │ │ ├── 023.jpg │ │ ├── 024.jpg │ │ ├── 025.jpg │ │ └── 026.jpg │ ├── taking-part-in-intuition-v8.0 │ │ ├── 001.gif │ │ ├── 002.png │ │ ├── 003.png │ │ ├── 004.png │ │ ├── 005.png │ │ └── 006.png │ ├── taking-part-in-polyfintech100-api-hackathon-2022 │ │ └── 001.jpeg │ └── your-intranet-over-the-internet │ │ ├── 001.jpg │ │ ├── 002.jpg │ │ └── 003.jpg └── seo.jpg ├── styles ├── globals.css └── highlight.css ├── tailwind.config.js ├── tsconfig.json ├── utils └── post-utils.ts └── vercel.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "next/core-web-vitals" 4 | ], 5 | "plugins": [ 6 | "prettier" 7 | ], 8 | "rules": { 9 | "prettier/prettier": "error" 10 | }, 11 | "overrides": [{ 12 | "files": ["*.mdx"], 13 | "extends": "plugin:mdx/recommended", 14 | "parserOptions": { 15 | "ecmaVersion": 6, 16 | "sourceType": "module" 17 | } 18 | }] 19 | } 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.{js,ts,json} linguist-detectable=false 2 | public/** linguist-detectable=false 3 | .husky/** linguist-detectable=false 4 | .yarn/** linguist-detectable=false 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env 30 | .env.local 31 | .env.development.local 32 | .env.test.local 33 | .env.production.local 34 | 35 | # vercel 36 | .vercel 37 | 38 | # typescript 39 | *.tsbuildinfo 40 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint-staged 5 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021–2022 Arash Nur Iman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Project banner](./function.svg) 2 | 3 | # function 4 | 5 | Welcome to the repository of function(), my blog (accessible at https://blog.arashnrim.me)! function() primarily focuses on sharing code snippets I find useful, experiences that I have gone through, and stories that I wish to share with the world. 6 | 7 | The source code features the following tech stack: 8 | 9 | | Technology | Description of use | 10 | | :------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 11 | | [Next.js](https://nextjs.org) | The framework used to power the entire website. Part of the Jamstack architecture, it allows me to easily build the website. | 12 | | [Tailwind CSS](https://tailwindcss.com) | The CSS framework used to style the website. It allows me to easily style the website while keeping the design standardised. | 13 | | [Vercel](https://vercel.com) | The platform used to deploy the website. It allows me to effortlessly publish live changes to the domain at a single push. | 14 | | [mdx-bundler](https://github.com/kentcdodds/mdx-bundler) | The Markdown-to-HTML parser used to read MDX content and turn it into plain HTML. It allows me to display my posts in Markdown in a way that React (via Next.js) can render. | 15 | 16 | ## Motivations 17 | 18 | For a while, I have visited the blogs of a few developers who shared interesting solutions to the problems they've faced that I had as well. I was impressed with how each blog was unique to its own self and the developer itself: content-wise, design-wise, and style-wise. In a way, blogs can be used to share more about an individual — not just a developer — through the way they write, design, and plan. 19 | 20 | That inspired me to create a blog of my own. Not to mention, embarking on a project like this allowed me to expand my horizons with what I know and learn new things while enjoying the process of learning by doing. 21 | 22 | ## Contributing 23 | 24 | This project is **_not_ accepting major contributions** as it is personal. However, if there is an issue — like a spelling or grammatical error, a visual bug, or other kinds of weird things happening — please feel free to [create an issue](https://github.com/arashnrim/website/issues/new). 25 | 26 | If you would like to leave comments about the source code — like possible design and code improvements, or other kinds of feedback — please feel free to [create an issue](https://github.com/arashnrim/website/issues/new) too if you wish! 27 | 28 | ## Licence 29 | 30 | This repository is made open-source with the [MIT License](https://github.com/arashnrim/website/blob/main/LICENSE.md), meaning that you are allowed to modify and distribute the source code as well as use it for private and commercial use provided that the licence and copyright notices are retained. However, if you are cloning or forking this project, **I ask that you remove the `posts/` folder** — whatever written in that should rightfully belong to me. For more information, visit the link above to learn what is permitted by the licence. 31 | -------------------------------------------------------------------------------- /cache/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "telemetry": { 3 | "notifiedAt": "1685860530116" 4 | } 5 | } -------------------------------------------------------------------------------- /components/Feedback.tsx: -------------------------------------------------------------------------------- 1 | import { useRouter } from "next/dist/client/router"; 2 | import { useState } from "react"; 3 | import { AiOutlineSmile, AiOutlineFrown } from "react-icons/ai"; 4 | 5 | const options = [ 6 | { 7 | icon: , 8 | text: "Liked the post?", 9 | key: "liked", 10 | }, 11 | { 12 | icon: , 13 | text: "Didn't like the post?", 14 | key: "disliked", 15 | }, 16 | ]; 17 | 18 | const Feedback = () => { 19 | const [buttonSelected, setButtonSelected] = useState(""); 20 | const [feedback, setFeedback] = useState(""); 21 | const [stored, setStored] = useState("false"); 22 | const router = useRouter(); 23 | 24 | const submitFeedback = async () => { 25 | const data = { 26 | option: buttonSelected, 27 | feedback: feedback ? feedback : undefined, 28 | post: router.asPath, 29 | }; 30 | 31 | await fetch("/api/feedback", { 32 | method: "POST", 33 | body: JSON.stringify(data), 34 | headers: { 35 | "Content-Type": "application/json", 36 | }, 37 | }).then((response) => { 38 | setStored(response.ok ? "true" : "error"); 39 | }); 40 | }; 41 | 42 | return ( 43 |
44 | {stored === "true" ? ( 45 |
46 |

Thank you!

47 |

48 | Your feedback has been sent successfully. I view feedback as 49 | something valuable, so I greatly appreciate you taking the time! 50 |

51 |
52 | ) : ( 53 | <> 54 |
55 | {options.map((option) => ( 56 | 77 | ))} 78 |
79 |
84 | 85 |

Would you like to give some feedback?

86 |

87 | You mentioned that{" "} 88 | {buttonSelected === "liked" 89 | ? "you liked the post. What parts of it did you like?" 90 | : "you didn't like the post. What parts of it could be improved?"} 91 |

92 |
93 |