Hello! I am Rafa and this is my website!
I am a software developer and the goal here is for me to write mostly things related to that. You can learn more about me here:
Rafa


Hello, my name is Rafael Pinheiro, and it’s great to meet you!
You can call me Rafa, spoken with a hard R. Like 
Hafa
.

I am originally from Brazil, a beautiful place that I recommend you visit sometime. Although maybe you should check for political conditions before you do that. I am from the south of Brazil and, in case you are curious, this is my hometown: Pelotas
However, I decided to go on a journey and I am now residing in the Netherlands, a place that has become my second home. Still struggling with the language though. Echt moeilijk!
My interests are diverse and tend to shift a lot. I am one of those people that when they have a new interest they need to dive in deep, making them forget of the world around them.
I enjoy travelling a lot, specially experiencing new cultures and expanding my mental horizons. I sometimes tend to take a bit of voyeuristic approach to that, making me more of an observer.
That led me to choose photography - mainly street protography - as a hobby to explore a more artistical side. And the nerd side of my personality led me to focus on analog photography. In fact, most photos you see on my instagram are film photography.
I enjoy reading and recently I have been interested in reading about politics and social matters. Of course there is always some time for a good fiction book.
A few books that I really enjoyed



My favorite songs right now
Some photographs of mine
You will find a search box and some links under the “Explore” header on the menu, where you can start looking for any content that you are interested in.
Networked Content
But I also would like to explain a bit about how I structured the content and some design choices.
Inspired by apps like Logseq
, Obsidian
and Notion
,
I tried to structure everything as a network of content.
Emphasys was put not only on the content itself, but on the connections that it has with other pieces of content.
Content Connections
You will see it reflected in a few ways as you navigate the website.
One of the coolest is this graph here:
But you will also see a list of linked pages at the bottom of every article.
Color Coding
I used some color coding to identify representations of content and their relationships.
Content
You will notice that both the html links on this website and the nodes on that graph
are in blue to represent the content itself.
Content Connections
While the hover style of the html links and the graph links between nodes
are in pink to represent the connection
between both pieces of content.
You can see some examples here!
And start nagivating:
-
Typescript
Typescript
TypeScript is a programming language that is a superset of JavaScript. It is maintained by Microsoft. TypeScript adds optional static typing and class-based object-oriented programming to JavaScript. This can help make code easier to read and debug. TypeScript is widely used in large-scale applications, especially in the Angular framework. It is also becoming increasingly popular in the Node.js community.There are several benefits to using TypeScript over plain JavaScript:- Type checking: TypeScript can perform static type checking, which can help catch errors before you run your code. This can make it easier to catch bugs and prevent problems when your code is running.
- Improved code readability and organization: TypeScript supports object-oriented programming, which can make it easier to organize and understand your code. This can be especially helpful for large-scale applications.
- Improved tooling: Because TypeScript is a superset of JavaScript, you can use existing JavaScript libraries with it. Additionally, many IDEs and text editors have built-in support for TypeScript, which can make it easier to write and work with your code. These tools often include features like code navigation and auto-complete, which can help you write and navigate your code more efficiently.
TypeScript can help improve the quality of your code and make it easier to work with large-scale applications. It can also provide a more structured and predictable way to develop JavaScript applications.TypeScript Introduction
- Basic Syntax
- Basic Types
- Type Inference
-
The
any
Andunknown
Types -
The
void
Andnever
Types - Interface And Type Aliases
- Type Compatibility And Type Casting
- Generics
- Async Stuff
Using It Effectively
Using TypeScript effectively means taking advantage of its features to write clear and reliable code that is easy to maintain and modify. This involves using TypeScript’s strong typing system to catch potential errors before they happen, using interfaces to define the shape of complex data structures, and using classes and modules to organize your code in a logical and reusable way. We will also cover some common errors you might see coming from TypeScript so you can understand what is going on and reach a solution faster. Overall, the effective use of TypeScript can help you write code that is safer, more scalable, and easier to work with. -
Astro
Astro
Astro is a modern static site generator that allows developers to create high-performance websites and web applications using TypeScript. Some of the key features of Astro include:Rendering Library Agnostic
Unlike most static site generators and frameworks that require developers to use a specific templating engine, Astro allows developers to use any front-end framework, library, or component they prefer. You can also mix and match them if you want, although you probably shouldn’t.Server-First Approach
Astro provides you Astro components, that acts in a similar manner to Vue and Svelte components, but that are just for server side use. It’s like the template files used to render HTMl from the back-end, but with a more modern interface and implementation. Even when you are using a library such as React or AplineJS, that is only used to render on the back-end side by default. The purpose of this is to keep the bundle size as small as possible, only adding what is strictly necessary.Islands
If you want to enable the UI library to be loaded on the front-end you can still do it, but you need to be explicit about that. We will discuss how to accomplish that when we talk about directives. But what you need to understand for now is that astro sees each page as static content with islands of interactive content. This blog for example, most of it is just statically generated content, aka a bunch of html files. But some parts of it, such as the search box in the menu, uses Svelte to manage user interaction and update itself. Svelte, or other UI library you might use, will be loaded only when an interactive land is present on the page, and they will only be mounted on those specific widgets instead of managing the whole page.Server-Side Rendering (SSR)
Even though you should prefer to render everything at build time so your website is blazing fast, sometimes you need to run some logic server side on every request. That is of course possible with Astro, both to to render HTML using components or for API endpoints that return JSON, XML or any other text format. This will limit you on deployment options or infer in extra costs as it will use lambdas or other similar feature available on your hosting provider.Many Built-in Features
It can be tiresome and even overwhelming to configure a project nowadays, you need to configure TypeScript, hot reloading, code splitting, tree-shaking and many other things. Most of it comes already configured and simply working with Astro, and of course you can customise it as well. But it is great to have such a great starting point.Simple Integrations
Adding a UI library, configuring Tailwind, adding Partytown or building it to deploy in vercel is very simple and rarely requires more than a command on the console. Maybe it won’t have the specific library you want to use but it is pretty simple to create a plugin for it.Keep tuned for a tutorial showing how to write a blog from scratch using Astro.