RSS Amplifier

Blog

Sirwan Afifi

Sirwan Afifi's blog

sirwan.infoRSS feed ↗92 posts

Latest posts

A Dev-Only Permission Inspector Built on React Fiber

A small dev-only inspector that links each permission check back to the DOM element it gated, using React 19's internals behind one adapter.

TIL: Kotlin's Generics Syntax Is a Pragmatic Compiler Trade-off

Kotlin's familiar generics syntax like foo () isn't trivial, it's a deliberate parser compromise inspired by C#

TIL: Using Homebridge to Add Non-HomeKit Devices to Apple Home

How to use Homebridge to connect non-HomeKit devices like the Levoit air purifier to Apple Home

TIL: Gemini CLI Now Has Agent Skills

Gemini CLI now supports Agent Skills

When Apple Podcasts Went Empty (Again)

The second time my Apple Podcasts library vanished, I decided I wasn't going to just wait for it to reappear. Here's what I learned by diving into the app's SQLite database and discovering how Apple Podcasts really works under the hood.

Learning Without Shortcuts

Learning without shortcuts: LLMs and AI agents have made my life much easier compared to, say, ten years ago. Learning new topics is now faster, more accessible, and even customisable to the way I want to be taught.

Sending Code from VS Code to Obsidian

A small VS Code extension that sends code snippets directly into your Obsidian vault

How I Use Back Tap and Shortcuts to Capture Info on My iPhone

iPhone has a hidden gem called Back Tap within its Accessibility features that I've found incredibly useful. As someone who values productivity and believes that a day without learning is a day lost, I've developed a workflow that transforms passive social media consumption into active knowledge capture.

ترندهای تکنولوژی در سال ۲۰۲۵

اخیراً دو پلتفرم معروف Pluralsight و O'Reilly گزارشی از ترندهای تکنولوژی در سال ۲۰۲۵ منتشر کردن که ارزش بررسی داره و یک دید اساسی بهمون میدن که برای سال جدید روی چه مهارت‌هایی تمرکز کنیم، تفاوت جالب این دو گزارش اینه که O'Reilly بیشتر روی تأثیر AI در حوزه‌های خاص (امنیت، شغل‌ و ...) تمرکز کرده، در حالی که Pluralsight بر اهمیت انطباق‌پذیری و یادگیری مداوم به عنوان مهارت‌های اصلی برای مواجهه با این…

Turning Notes into Knowledge

Taking notes is essential for learning and retaining information, but without regular review, those notes lose their value. Over time, I’ve discovered that how you revisit and engage with your notes matters just as much as taking them.

How I Use Obsidian to Publish Posts

Obsidian has become a key part of my daily routine—it's one of those apps I always keep open on my computer. While I started using it for journaling, planning tasks, and reviews, it has now become my main tool for writing blog posts too.

Advent of Code 2024

As we approach Advent of Code 2024, I wanted to share my experience from previous years tackling these coding challenges with perhaps an unconventional choice of tools: PowerShell and Pester. While PowerShell is often pigeonholed as just an automation tool, I've found it to be a surprisingly powerful language for algorithmic problem-solving, thanks to its foundation on .NET and its expressive…

Microsoft.Extensions.AI

With .NET 9.0, a new set of abstractions has been introduced to simplify integrating AI into applications: `Microsoft.Extensions.AI`. This package offers a consistent programming model by wrapping various AI providers (such as OpenAI, Azure OpenAI, and Ollama), allowing .NET developers to work seamlessly with different models.

Git Commits as Documentation (RAG-Powered Commit Search)

If you know me, you know that I love Git, and I believe if you use it right, it can be a powerful tool not only as a version control system but as a documentation tool. With Git, we basically document our code changes over time.

A Weekend with Chrome AI

Building a Chrome extension to summarize web pages

HTML Parser and Whitespace

The HTML parser treats whitespace characters between elements as text nodes

موختەسەر لە بارەی موهیم بوون نووسین بلاگ

مختصر له باره‌ی LLM

Local AI Models in Browsers (Chrome Canary)

Browsers and operating systems are increasingly expected to have access to language models. This could really boost productivity, making tasks like translation and summarisation a lot easier.

My Approach to Problem Solving - Blazor Version

Here's how I tackle my programming tasks using Test Driven Development (TDD). I first try to understand the problem and then break it down into smaller tasks. TDD helps me do this effectively. I don't use TDD just to write tests; it's a way to manage and solve problems step by step.

System-Versioned Tables in SQL Server/EF Core

Azure API Management

I have been playing around with Azure API Management lately and really like it. It's a great way to manage your APIs, essentially serving as an API Gateway to handle incoming API calls and route them to various backend services. The backend service could be any HTTP API, WebSocket, GraphQL, Azure Function, Azure App Services, etc.

Redis RESP

RESP (REdis Serialization Protocol) is a binary protocol that Redis uses to communicate with clients. It is a simple protocol that is easy to implement in any programming language. This means that we can communicate with Redis over a socket connection. For instance, here is a naive implementation in C# that sends a command to Redis and reads the response:

Securing Next.js Apps Using Microsoft Identity Platform

In a previous article, I explained how to secure a Blazor application using the Microsoft Identity Platform. In this article, I will demonstrate how to secure a Next.js application. The process is almost identical in terms of the steps required on the Azure portal; however, the implementation differs.

Securing Blazor 8.x Web Apps Using Microsoft Identity Platform

Implementing authentication and authorisation is always a bit of a headache. There's always those edge cases you forget about when doing it yourself. It's smarter to let a third-party service handle Identity and Access Management stuff. Azure's got you covered with Microsoft Entra ID (you might know it as Azure AD).

Beyond Titles, Embracing Data Analysis in Every Tech Role

I use LLMs daily for a wide range of activities, including personal and work projects, as well as for my blog. They help me automate tasks, analyse data, and make decisions, thereby simplifying my life and enhancing work efficiency. Last week, my boss requested a report on our current status, including areas where we are investing more time and money. I had already developed a system to send daily…

A Weekend with Swift

Every Friday night I try to do something to get my dopamine flowing to start my weekend. Programming is one of the things that does the work for me and increases my dopamine level so much that if I start focusing on something, nothing can distract me. I can keep going for hours after hours without feeling tired, which sometimes isn't good. We should definitely pay attention to our health and get…

Programmers and LLMs

If you're a programmer like me, you might also like making things easier by [automating stuff](https://automatetheboringstuff.com/). This isn't about being lazy; it's about being efficient. For instance, when I'm shopping at [Tesco](https://www.tesco.com/), which is my go-to supermarket in the UK because it's cheaper and right next to my house, I always think about how I can speed up the shopping…

Migrating to Astro

Astro is a new kind of static site builder that delivers lightning-fast performance by bringing together the best of modern build tools like React and GraphQL, and serverless deployment with Vercel. In this post, we'll walk through how to migrate an existing MDX blog to Astro.

A Quick Note

My colleague was assigned a task in which he had to set up open-source software on one of our servers. The process was a bit tricky, making the installation challenging, so he was somewhat disappointed to not finish his task. This is one of those moments when you want to fix a problem, but so many things happe

آشنایی با TypeChat

در دنیای Generative AI مفهوم Prompt نقش خیلی مهمی را ایفا میکند؛ چون برای گرفتن یک خروجی با کیفیت میبایست یک ورودی یا Prompt با کیفیت و خلاقانه داشته باشیم؛ این قضیه به قدری اهمیت دارد که یک عنوان شغلی هم برای آن در نظر گرفته شده است Prompt Engineer؛ چون اگر یک Prompt به خوبی نوشته نشود، نتایج غیرواقعی و نادرستی میتواند تولید کند که به این رفتار…

iPhone

On April 30, 2023, I was out with my friend, and we were traveling back home from London Waterloo to Guildford. We had to wait a couple of hours for the train to Guildford, so we decided to pass the time by traveling back and forth from Waterloo to the Northern line. While on the tube, both of us fell asleep, and my phone was on my lap...

Visualising Your IoT Data

Recently, I've learned a lot about the Internet of Things (IoT) and I just gotta share some of the cool stuff I've found. I'm using the ESP32 module to gather data from a temperature sensor and humidity sensor. I've used the Arduino IDE before, ..

Different ways of adding your signature on a PDF

My coworker wrote some Python code to add a signature on PDFs. Since Python isn't my thing, I wrote the same code in a few of my favorite languages. Probably because I haven't used Python in production or because of its wired syntax (Maybe I only like curly-brace languages). Anyway, here's the Python code I mentioned:

انجام یک تسک ساده با Golang

یکی از کارهای خسته‌کننده برام web automation هست؛ ابزارهای زیادی برای این کار توسعه داده شدن معروفترین‌هاش Puppeteer، Playwright هستن. برای یک پروژه نیاز بود یک فرآیند رو به صورت headless انجام بدم؛ چون با این دو ابزار زیاد کار کرده بودم تصمیم گرفتم با یک چیز متفاوت جدید تسکم رو انجام بدم بنابراین پروژه رو با Golang شروع کردم و از go-rod استفاده کردم.

بررسی خطای undefined is not iterable در JavaScript

Iteratorها این امکان را به ما میدهند که بر روی یک مجموعه iterator کنیم؛ به شرطی که مجموعه iterable باشد؛ در JS مقادیر زیر iterable هستند به این معنا که میتوانیم آیتم‌ها را یکی یکی پیمایش کنیم:

Blazor Meetup

On May 4, 2022, I attended a meetup at one of Microsoft's campuses in Reading. This was my first time at a meetup like this. It was about Blazor on .NET 6 presented by Steve Sanderson. I was already familiar with him from his previous work Knockout, which was/is an MVVM framework designed for the web. These days, I mostly build web applications using Node.js/React. In addition, I have been looking…

نکات Golang

مدتی است در حال یادگیری Golang هستم. Golang یک زبان statically complied است که توسط Google توسعه داده شده است. اینجا نکاتی که در مورد Golang یاد میگیرم رو سعی میکنم به صورت پراکنده به اشتراک بذارم.

تولید فایل‌های PDF توسط React

تهیه فایل PDF تا حدودی چالشی است به خصوص زمانیکه بخواهیم یکسری کامپوننت ری‌اکتی را تبدیل به PDF کنیم؛ در یکی از پروژه‌هایمان امکان تهیه فایل PDF را در اختیار کاربران قرار داده‌ایم. روال کار به این صورت است که ابتدا کاربر با کلیک روی یک باتن یک گزارش تهیه میکند سپس کاربر باید امکان پیش‌نمایش گزارش را نیز داشته باشد. تا اینجای کار خبری از PDF و تولید PDF نیست و چیزی که به کاربر نمایش داده میشود…

ذخیره فایل CSV در SQL Server

سری قبل در مورد ذخیره کردن یک فایل CSV توی دیتابیس MySQL توضیح دادم. در ادامه نحوه ذخیره یک فایل CSV در SQL Server رو بررسی میکنیم. برخلاف MySQL در SQL Server استوریج انجینی برای فایلهای CSV تعبیه نشده و خودمون باید فایل CSV رو بخونیم و بعد ذخیره کنیم. برای اینکار ابتدا نیاز به نصب SQL Server روی macbookم داشتم در نتیجه از داکر برای اینکار استفاده کردم

آشنایی با CSV Storage Engine در MySQL

MySQL از چندین Storage Engine پشتیبانی میکند؛ Storage Engine در واقع کامپوننت‌های MySQL هستند که عملیات SQL را بر روی جداول میسر میکنند.

Showing Topbar Progress Indicator in React

I use circular loading indicators in my React applications before data is returned from the server...

Using Mirage With Vite

Recently, I have been using Vite and liked it quite a bit. It's an extremely fast build tool, If you haven't checked it out, you should definitely do so. Although it was developed by Evan You, it can be used for React, Svelte, and more...

Web Server Logs

An important part of managing software applications effectively is keeping logs, because they provide information about the server's performance and activity and can indicate any issues. An application's behavior has to be analyzed in order to track events and debug any issues...

disallow nested ternary expressions (no-nested-ternary)

We usually use ternary operator as a shortcut for `if` statement, For instance, in React applications we can use them to conditionally rendering elements inline...

OS Notification

I recently tweeted something about a little script I had put together to automate one of the tasks I had always struggle with. I thought it would be a good idea to share the process in a little bit more detail:

MySQL - Transforming JSON data into relational tables

MySQL provides some built-in functions to work with JSON data. One of which is JSON_TABLE which maps JSON data into a temporary relational table.

Getting Started With Sequelize

Sequelize is an Object Relational Mapper (ORM) which enables us to query and manipulate data stored in a relational database. There are several ORM for Node.js out there...

WebSocket and React

WebSocket is a communication protocol. It's bidirectional in nature which means that either client or server can send data at any time. With WebSocket, we can build applications such as multiplayer games, ...

Displaying Secured Images

Ran into an interesting problem this week with displaying secured images on the page. The problem is that `img` tag doesn't show the image if the resource is secured with a token or a username/password...