Compare commits

..

39 Commits

Author SHA1 Message Date
3dee555c5c feat: adding gist section with pointer vs value gist 2025-11-24 20:42:22 +00:00
8fe9bd28dd taking accountability post 2025-11-17 21:45:07 +00:00
f52263238e bruh 2025-09-14 20:25:52 +01:00
0f21bfc3fd work 2025-09-14 20:25:45 +01:00
2566414e47 fix: title 2025-08-18 21:57:38 +01:00
0c885d0b32 fix 2025-08-18 21:55:52 +01:00
2aee377e54 new post about validation 2025-08-18 21:52:59 +01:00
f486aa58c3 fix: changing to and tv 2025-07-22 20:18:38 +01:00
4495eab334 test 2025-07-22 20:17:49 +01:00
61f615c1d5 feat: adding books section 2025-07-22 15:36:08 +01:00
4a7161b102 requesty 2025-07-07 20:58:07 +01:00
618bfb2e14 feat: life recently 2025-06-21 14:15:12 +01:00
147b96fcb0 feat: self hosting post 2025-06-08 17:56:58 +01:00
67e3155518 feat: adding ssh line 2025-06-07 11:59:04 +01:00
b3a2e00a7b feat: better landing page 2025-05-28 14:38:38 +01:00
b7cc066956 Revert "feat: regular font for easier reading"
This reverts commit 435c5c7847e1e33ba995ac826470d3021506d6fd.
2025-05-12 21:15:53 +01:00
435c5c7847 feat: regular font for easier reading 2025-04-09 16:52:21 +01:00
bc04cbfc54 fix: email to 2025-04-04 12:15:18 +01:00
7f2025875b fix: gitea to profile 2025-04-04 12:12:12 +01:00
3d689aa9af feat: adding converge 2025-04-04 12:11:34 +01:00
73f1289e25 feat: email 2025-04-04 12:10:33 +01:00
f176cc23c0 feat: adding gitea 2025-04-04 12:10:22 +01:00
18bb9d753f fix: cloudflare running an older version of hugo 2025-03-12 23:14:28 +00:00
e624ed78b6 fix 2025-03-12 23:12:22 +00:00
82c0c1d492 fix: rss feed now displays full content 2025-03-12 23:09:11 +00:00
f0495c5f7c feat: adding rss 2025-03-12 22:48:07 +00:00
1b5ff4d378 fix: recent posts 2025-03-12 22:42:42 +00:00
af0eacefe2 gitea post 2025-03-12 22:26:48 +00:00
9125b73399 Loose coupling blog post 2025-02-05 22:03:48 +00:00
22ccf75c85 fix: title 2024-11-28 16:29:13 +00:00
714c6ee899 link 2024-11-28 16:28:06 +00:00
5e7f87f1a0 feat: advent of code 2024-11-28 16:26:45 +00:00
1d621666fb feat: real time trading system 2024-11-28 16:24:05 +00:00
53a848726f feat: advent of code post 2024-11-28 12:11:07 +00:00
0501d7ac9b feat: moving out blog post 2024-11-18 22:42:37 +00:00
b1dd4c7781 fix 2024-06-16 23:33:03 +01:00
742c96ad83 fix 2024-06-16 23:31:36 +01:00
af2358ac05 Merge branch 'main' of github.com:JohnCosta27/JohnTech 2024-06-16 12:19:08 +01:00
182ac1a438 feat(sedated): blog post 2024-06-02 19:45:00 +01:00
42 changed files with 953 additions and 30 deletions

1
_index.md Symbolic link
View File

@ -0,0 +1 @@
content/_index.md

View File

@ -3,27 +3,56 @@ title = 'Home'
date = 2023-11-14T17:55:14Z date = 2023-11-14T17:55:14Z
+++ +++
# Hi, I'm John # Hi, I'm John Costa
--- ---
I am a Software Engineer, currently working at Decipad. I'm interested in various subjects including: Compilers, Linux Servers, Web Development, Distributed System and many more. # About Me
I'm a Software Engineer currently working at [Requesty](https://requesty.ai). I do full-stack products, host my own services under my desk, solve coding problems and love to read.
Read my website on your terminal `ssh -p 23234 blog.johncosta.tech`.
---
# My Projects
## [Haystack](https://www.youtube.com/watch?v=tPOEJewdj8Y)
A tool that uses AI agents to extract information from images, screenshots or pictures. It then creates entities such as locations, events, notes, etc... and gives the user an easy way to search for them. Currently this is in Alpha stage, if you'd like access you can [email me](mailto:me@johncosta.tech).
## [Converge](https://converge.sh)
A simple website that allows users to list their links, and share them in person using a QR code. Similar to linktree but intended to be used in face-to-face meetings. You can see my profile [here](https://converge.sh/1).
## [Hybrid Poker](https://github.com/JohnCosta27/Poker)
This project has two parts.
1. Poker hand evaluator and game loop. I used Zig's [comptime](https://zig.guide/language-basics/comptime/) to generate arrays that allow any poker hand to be evaluated in O(logn), with potential to expand to a O(1) evaluation, the algorithm is based on [Cactus Kev](https://zig.guide/language-basics/comptime/).
2. Live playing. The idea behind the project is to allow my friends and I to play poker whilst some of us are together in a room, and some of us are away. I've setup a deck with NFC tags which the dealer uses so the program knows which player has which cards. At the end all the hands are saved and can be replayed.
## [Arcio](https://github.com/arcio-uk)
A management information system (MIS) to help schools and universities mark attendance, manage timetables and organise courses. I worked on this project with 3 other engineers and even trialled it at our university - Royal Holloway. Although the project works, we could not get funding from our university to continue the work. The code is now open source.
The system was capable of.
- Taking attendance of hundreds of students at the same time, and scale to meet demand.
- Manage courses, modules, tutors and students involved in each one.
You can find the rest of my projects on the [projects page](https://johncosta.tech/projects/).
---
# Work # Work
Currently working at [Decipad](https://www.decipad.com/) as a full stack engineer. ## [Requesty](https://requesty.ai) (2025-Current)
I was hired 6 months after the product launched, and joined the team as the 2nd hire. We are building an AI-Gateway to support application development and development teams, providing analytics, cost saving, fallbacks and lots of other interesting things! We are moving very quickly, and so far I've mostly worked on the gateway, building latency based policies, and many other improvements.
I worked in various project at my old university [Royal Holloway](https://www.royalholloway.ac.uk/), including a Wellness and Professional Development application, that allowed students to track their wellbeing and various professional skills. ## [Decipad](https://decipad.com) (2022-2025)
I worked as a full-stack software engineer at Decipad. I was the lead developer for our interactive notebook, that allows users to build models with interactive widgets, rich text, calculations and tables. The editor also supports live-collaboration, multiple tabs and offline editing.
Worked on a [InnovateUK](https://www.ukri.org/councils/innovate-uk/) funded project called Tensorcrypt, which allowed for zero-trust data analysis. I've also been responsible for refactoring various parts of the code base. I migrated our old create-react-app frontend to a more modern Vite + Rollup (with SWC), this allowed our developers to have instant updates instead of having to wait 10-15s for their changes to have effect. Furthermore I implemented type generation on our GraphQL server, which reduced backend bugs by 90%.
I am also a private GCSE/A-level Maths and Computer Science tutor, and have over 300 hours of tutoring experience. Before leaving, I was working on augmenting our notebooks with a chat, and BigQuery integrations (which we call data lake). This allows users to bring their own data, which we then sync to BigQuery every day, and allow the AI to interact with it.
--- ## [Lead Engineer at Codegroovers](https://www.royalholloway.ac.uk/research-and-education/departments-and-schools/computer-science/news/one-year-of-code-groovers/)
I was hired to lead the build a proof of concept system for the universities well-being team. This system allowed students to view all the universities well-being resources in one place, allowed them to keep track of their mental health, and provided charts for measuring progress. It also had a professional development part which allowed users to explore their future careers. You can find the code [here](https://github.com/JohnCosta27/WellbeingApp).
# Projects ## Private Tutor
Since 2019 I've been a private tutor, providing GCSE and A-level lessons in both Maths and Computer Science. I've done over 300 hours of lessons, all my students have achieved an A or above (7 for GCSE grades).
I've developed various projects, which I have listed on the [projects]({{< relref "./projects/_index.md" >}}) page. There you will find blog posts, GitHub Repos and _maybe_ a YouTube video.
--- ---
@ -32,11 +61,3 @@ I've developed various projects, which I have listed on the [projects]({{< relre
I attended [Royal Holloway](https://www.royalholloway.ac.uk/) and achieved a First Class Honours BSc Computer Science. I attended [Royal Holloway](https://www.royalholloway.ac.uk/) and achieved a First Class Honours BSc Computer Science.
Previously I attended [Farnborough Sixth Form College](https://farnborough.ac.uk/) and got 5 A-levels. Previously I attended [Farnborough Sixth Form College](https://farnborough.ac.uk/) and got 5 A-levels.
---
# Interests
Outside of Computer Science, I play guitar (mostly metal), read and do Judo (currently a Red Belt). But I spent most of my time behind a screen, tinkering with software, or [ricing](https://excaliburzero.gitbooks.io/an-introduction-to-linux-ricing/content/ricing.html) my machine (again).
I like to take part in the [Advent Of Code](https://adventofcode.com/), and have various repo's for each years solutions.

View File

@ -0,0 +1,50 @@
+++
title = "Hello Gitea"
date = "2025-03-12"
author = "John Costa"
toc = true
tags = ["Software", "homelab"]
+++
# TLDR
> I use my own Gitea instance now! [git.johncosta.tech](https://git.johncosta.tech)
Three days after I moved into my apartment, I bought a server. A small, fairly low power Fujitsu desktop, from facebook marketplace. Since then I've been really into self-hosting, so far I have.
- [Immich](https://immich.app)
- [Jellyfin](https://jellyfin.org)
- [Pi-hole](https://pi-hole.net)
- [Planka](https://planka.app)
- [Grafana](https://grafana.com)
And a couple of others.
Point being, I've really enjoyed the journey of managing and using all these services. In the future I'll write more in detail about my setup.
# Gitea
I came across [Gitea](https://about.gitea.com), and prompt closed it - surely GitHub is unbeatable, right? But it kept bugging me, but at the same time I thought.
- It's probably too hard to manage.
- SSH would be too weird.
- GitHub is just better.
I was wrong on all fronts.
In fact, this might be the service I most enjoy using (although they are all pretty great). Having ownership over my code has felt good, and the WebUI is snappy and a pleasure to use, and because it's self-hosted it's super quick (I only have to go through LAN most of the time).
## But GitHub?
### Open Source
I still believe GitHub is the best for open-source projects - it's just more popular - and therefore much easier to people to contribute. But for private code? Or personal projects you don't expect to have contributors to? Why not try another service?
### The AI problem
GitHub was (and for the most part still is) an incredible service, but now it's using it's massive amounts of code to train AI, whether you want to or not. It's perhaps not worth it to trade privacy for convinience anymore.
I also do not trust a huge company (Microsoft), to not use my private repo's to train AI.
# Conclusion
So far, I love Gitea. It's super fast, incredibly easy to setup and manage, and it's completely open source. And from now on, my personal projects and private projects will be self hosted. Check out [git.johncosta.tech](https://git.johncosta.tech) to view my public repo's on there.

View File

@ -0,0 +1,163 @@
+++
title = "Keeping it safe and simple. My preferred way to verify API requests in the frontend"
date = "2025-08-18"
author = "John Costa"
toc = true
tags = ["Software"]
+++
The challenge of keeping backend APIs and frontend applications in sync has been around for a while, and there are many different solutions from this problem.
The simplest one is to ignore it completely. Look at what the API returns, and use those values in the frontend without any sort of parsing or validation. This works, for a time. Eventually, the API will change, and if you're lucky it will change in a big way, making it obvious that you are no longer in sync. But if you are unlucky, it will change in a small, miniscule way, that will lead you down hour long debugging sessions for some weird, undefined behaviour. I don't recommend this approach, unless you have complete control over both, and even then, this is one small human error away from being a nightmare.
An extension to this approach would be have your backend API fit an OpenAPI schema, which makes it easy for tools to generate the types, and potentially validators (which we'll get onto later), for your API. This approach is good, but it involves some level of maintenance for compliance with the OpenAPI schema, and also external tools to generate code for you. However, I would actually recommend this approach under certain scenarios.
The other approaches I see are more complicated. They involve standardising the API in some way, this is where GraphQL would come in. The frontend asks for the data, and if the data is not returned in the expected way (types and all), then you will get an error. The experience of developing with this approach are good, for the frontend developer (to an extend). But it involves changing your API completely, potentially making it much harder to develop, harder to maintain, less performant, and overly complicated.
Another similar approach is the use of tools such as tRPC. It's somewhat similar to GraphQL, but it is TypeScript specific. This probably has the best developer experience if you're working with TypeScript only. But again, you're changing the backend again to fix the problems of the frontend, not to mention you are restricted to using TypeScript on the backend. There are other tools or standards, such as gRPC, which would allow you to use this for any language, but again, you will have to make the API compliant.
## Parse the response
In my experience, guessing the types, will only get you so far. To have a good, scalable(ish) solution, which will save you countless hours debugging, you need to parse the response you get from the API. This is what GraphQL does, what tRPC does and plenty of other API standards do. But I don't want to use any of those, I want a simple REST API (and note, I'm using REST loosely here, I'm not referring to perfect REST standard APIs, just APIs that return some data when asked).
Instead of making the burden of maintenance on the backend side (like OpenAPI schemas), I shift it to the frontend, by writing validators which can look at a response, and tell me if anything changed, or if the response is correct.
The reason I like this approach is because it is simple. All I need is a basic validation library (such as Valibot, Zod, or any other), and write what I'm expecting the response to look like, and then parse it. Even better, now you have TypeScript types, that you know for sure are not lying to you. You also get integration testing, you can run all the requests from the backend and make sure the corresponding validators pass, and if not, then you know something changed in the API.
## Implementation
We'll start off by writing a helper function `createEndpoint`, which allows me to define an API request, give it a schema, and have it handle the parsing for me.
I'll show the code section by section, and explain as we go along.
```typescript
import type { StandardSchemaV1 } from '@standard-schema/spec';
```
This is an interesting part of the code. A recent project called `standard-schema`, has made it very easy to swap out what validator you would like to use. This means that my function can take a validator from Zod, Valibot or any of the other libraries which implement this interface. You don't even need this library to be in your dependencies, you could copy it straight from their website. Pretty neat.
---
```typescript
type RequestFnWithSchema<T extends StandardSchemaV1, TFn extends (...args: any) => any> = {
fn: (...input: Parameters<TFn>) => Promise<StandardSchemaV1.InferOutput<T>>;
['~schema']: T
}
export const createEndpoint = <T extends StandardSchemaV1, TFn extends (...args: any) => any>(
schema: T,
fn: TFn
): RequestFnWithSchema<T, TFn> => {
return {
fn: async (...input) => {
const res = await fn(...input);
const x = schema['~standard'].validate(res);
if (x instanceof Promise) {
throw new Error("unreachable");
}
if (x.issues != null) {
throw new Error(JSON.stringify(x.issues));
}
return x.value;
},
"~schema": schema,
}
}
```
This method takes two parameters. The first is a schema, this is what your data looks like, the part that you have to write by hand. The second is the request function. This can be anything, but usually it's a simple function that returns a promise.
We return an object that contains the function to call, and also the schema it uses. This is most so we return a type rather than a function, because I don't want this to get mixed up with other simple functions that request data from the API, I want to make it distinct.
The callback function is first called with the correct arguments, we then take the schema and validate the response from the callback function, Make sure there's no issues and return the parsed value. This function will throw if there's an error, this is mostly to keep this example simple, but you can choose to return an error value instead, create your own Error class and throw that, whatever you want.
The return type for this function is `RequestFnWithSchema`, which is just a helper type, that returns a correctly inferred value, so you get nice TypeScript types on the other end.
Here's an example of how you would use this:
```typescript
import { array, object, string } from "valibot";
import { createEndpoint } from "./frontend";
const userSchema = array(object({
id: string(),
name: string(),
}));
export const userEndpoint = createEndpoint(userSchema, async () => {
const response = await fetch("http://localhost:1234/users").then(r => r.json());
return response;
});
```
You can see now I am writing the schema using valibot. I then pass it over to the `createEndpoint` function, and a callback which takes no arguments and returns the JSON response (note that I am assuming the API always returns JSON or the fetch throws an error).
Like this, you now get a lovely typed request function, by doing `userEndpoint.fn`, TypeScript knows it doesn't need any arguments, and will use `userSchema` to infer the return type. And all the complexity of parsing the request is hidden inside `createEndpoint`.
You can pass in parameters as well, very simply.
```typescript
const singleUser = object({
id: string(),
name: string(),
});
export const createUserEndpoint = createEndpoint(singleUser, async (params: { name: string }) => {
const response = await fetch("http://localhost:1234/users",
{
method: 'POST',
body: JSON.stringify(params)
}).then(r => r.json());
return response;
})
```
## A little about validators
There is a small detail that is easy to overlook by looking at the code above. The `object` part of the schema hides away the fact that it does not perfectly match the object. Take a look at the following:
```json
{
"id": "id",
"name": "name"
}
```
This is exactly what you expect to pass validation - and it does - but now take a look at this object.
```json
{
"id": "id",
"name": "name"
"surname": "surname"
}
```
Valibot (experience may differ with other libraries), the standard `object` validator removes extra fields. This is actually key for enabling migrations, which I'll talk about further down. To recap, this object passes validation, but the extra field is stripped away. So TypeScript is still telling the truth.
The validation fails when a field isn't present, or has an incorrect type. Such as:
```json
{
"id": false,
"some-field": "not-name"
}
```
This fails. And Valibot is very useful at pointing out the errors, `id` is not of type string, and `name` is missing.
## What happens when the API changes. Development & Production.
Let's keep the user validator as an example. What happens when the API changes? And there are two scenarios where the schema you have on the frontend, does not match the response that your API does.
Number one, you're developing the backend API - or someone else has and hasn't changed the frontend schemas - and you validator crashes. But wait you're saying, the example above clearly shows that the extra fields are ignored, and therefore, potentially bugs can pass through. One more thing we can do to make development air tight, is to change the `object` to a `strictObject`. This way, there is no escaping that API change, the moment an extra field is added you will know about it, because your frontend will crash. This is very important to make sure that you get small and fast errors now, instead of bigger bugs which take you a while to figure out.
One very important thing is: we _only_ want this `strictObject` for development, because shipping it to production will mean that anyone with an out of date frontend (which happens a lot), their application will crash. The most common migration you make is adding fields, which is very easy with `object`, just add a field. If it's present but the validator doesn't see it, it will ignore it.
## Conclusion
This is a practical way to create types that you know are true. You can also be extra strict during development and flexible to allow for users with outdated clients still use the app. It's not perfect, but it is still my favourite way of validating on the frontend.

View File

@ -0,0 +1,31 @@
+++
title = "Life, Recently."
date = "2025-06-21"
author = "John Costa"
toc = true
tags = ["life"]
+++
I have been going through an unusual period of unbusyness. Normally I tend to be quite busy, working my full-time job, working on side projects after, going to the gym in the morning and talking to friends some evenings, and the weekends tend to be much of the same, only that I work on side projects the majority of the day.
## So what has happened recently?
My work has slowed down quite a bit, I have also been on two holidays in one month, with 2 weeks in between, one to Scotland and one to Lisbon. Both were quite nice, and I managed to see a lot of both of these wonderful places. But this has meant that my last 4-6 weeks have been lacking a certain busyness I was used to.
This sounds great, doesn't it? Well... Yes. I recently watched 9 hours of TV in a single day, I don't remember ever doing that before. It felt _ok_, I'm glad I'm in a position where having such unproductive days doesn't hurt, but it does leave a sense of unnacomplishment (although this particular example I was somewhat proud of, in a weird way), this is something I have fought with for about a year now, and I'm starting to understand this feeling better.
I've learnt to appreciate this feeling, it pushes me to do _something_, it isn't something to fight, it is something to be grateful for. It pushes me to continue learning, continue working and push myself. It goes away once I've completed a good days work, when I've been to the gym, and when I've made a good, healthy meal.
## What about (remote) work?
Firstly, I will try and get back to a good state of bussyness, first and for most.
Secondly - although I am a big believer in remote work - I understand the need to leave the house. This is not some revolutionaty idea I have discovered, I've known that practically anyone who does remote work for a long time wants to leave the house. Maybe not for an office, but for a coffee shop, a co-working space, the park. Literally anywhere but their house (obviously from time to time).
So an action I will undertake is to try and leave the house everyday, and during weekdays I will try and work - at least 3 days - outside of my home office. This will mostly come in the form of going to a London office, in general I want to spend more time in London, as I always have fun and meet incredible people when I take the time to go to events, spend time at the pub, or simply working from the office. My mental health improves and so does my work.
However, the time I spend at home I also want to be better. The home office can be an incredibly productive space, and I want to keep it that way. I will come up with rules around using my phone near my desktop, about starting the day right when I am at home (waking up at the same time), and a few other baselines which I want to achieve. I might also write a blog post about these, more in detail.
## Conclusion
I'm somewhat unhappy with my current productivity. I feel like I am lagging behind, not keeping up with industry trends and much as I should - and most importantly - I am not programming enough.

View File

@ -0,0 +1,71 @@
+++
title = "Moving Out"
tags = []
date = "2024-11-18"
author = "John Costa"
toc = true
+++
On the 29th of October 2024, after 7 months, I finally moved into the apartment that me and my girlfriend [[Rio]] bought. This is the first time that me or her have lived on our own.
I'd like to talk about my experience, how it affected me, what went well, what went wrong, and how I'm doing after 3 weeks. And how Woking is treating me.
# The Process
As anyone experienced with buying flats in the UK, then you know the process takes a very long time, and 7 months is somewhat normal. I won't get into too many details, but there is a lot of paperwork needed, from a lot of different people.
This challenged me a lot mentally. I found myself in limbo, unsure of when I would get out. I really enjoyed living with my mum, and I can't complain about my time at home. I was treated with respect as an adult, which I thank my mum and her partner for massively. Nevertheless, the mental strain on not knowing when the buying process would finalise and when me and Rio would move in, was though. I started seeing a therapist to help with this and other aspects of my life, I did so for about 5 months, and I recommend anyone who is struggling mentally to seek help if help is available, luckily I didn't have serious problems, but I was still able to work through them, and now feel better equipped to deal with various wonders of life.
Limbo wasn't the only feeling however. Pressure was a big one too.
As readers know, buying property requires a mortgage and a deposit. This deposit in my case was 10% of the total value. I've been fortunate in life and I've work since I was 16. I worked throughout my entire time at university, through tutoring and software projects, and the internship at Decipad in my third year. \[As I side note, I feel extremely grateful to all the opportunities presented to me, and I'm quite proud of myself for all that work, it wasn't easy at times, but it paid off (this sounds really vain, I really don't mean it that way).\]
I have also worked full-time at Decipad since I graduated in May 2023, which again, helped me save the required money for the down deposit, legal costs, and moving in costs (furniture, and stuff like that).
This is by far the biggest financial decision I've made in my life, and it comes with pressure. It is something I've wanted to do, and have had in my head for quite sometime, which helps. But the pressure is still there (even today). I have a mortgage now.
# Moving In
We exchanged on a Thursday (24/10/2024) and completed on Tuesday (29/10/2024), leaving the weekend to pack. Me and Rio did so and on Tuesday, we hired a van. Which we used to pick up a sofa we had bought at the weekend, and grab the stuff from mine and her house.
Around midday we went to the estate agent to actually pickup the keys, and go to the flat for the first time in 7 months. Going in is quite a surreal feeling, but a very happy one.
Took us the whole afternoon, but we managed to move everything in. And we've been slowly unpacking ever since.
# Living alone (together)
Usually people say it's a shock, I don't feel it that way. I was quite used to cooking, cleaning and maintaining (at least part) of a home, so doing chores and keeping the place tidy, cooking meals has been one of the easier parts of the whole process. I find it pleasant (especially cooking), there's something freeing about things not being done if you (or Rio) don't do them.
## Living with a partner
This has been the best part. Me and Rio have been together since we were both 16, so around 7 years, and we click, and we continue to click once we moved in. There are certain aspects that took some communication, we're different human beings after all, but I feel like we're quite open about preferences and dislikes about the apartment.
It's not perfect, but no two people living in the same place are. But I'm very happy with how we're doing.
# Working (in Woking)
I work remotely the majority of my time (I sometimes go into our London office, which I'll talk about below), and we specifically bought a 2 bedroom apartment so one of the bedrooms would become an office. We have two desks side by side, one for me and one for Rio.
I get the most use out of this room since I'm the one who works from home, and it's really n upgrade. I used to work in the same place I slept, which worked fine and carried me through university, but since I started working full-time, slowly I've been feeling worst and worst about my work situation. It was very hard to focus, and painful to disconnect. A dedicated room for work (or some leisure, video games mostly), is really great.
# Woking
I love this town. It feels busy without being overly busy. Almost everything I'd like is close by (looking at you Waterstones), and within walking distance. The parks, the people and the shops are all great, it's a great place to live.
Another reason I choose Woking is because it is a 25 minute train away from London. And I am 5 minutes away from the train station.
There isn't much else to say, I just really like this town.
# What I'd like to do better
It is still early days, so I won't beat myself up too much about these, but there are some points I'd like to improve upon.
1. Work after work, continue to build personal projects, do coding puzzles. Don't fall into the trap of working, eating, sleeping repeat. Go to conferences, etc...
2. Exercise. I have started on this point, but it is one I really want to get better at, I want to continue with Judo, and become good and physically fit.
That's it so far. I'm sure I'll come up with more but those are the two points I really want to focus on.
# Conclusion
I moved out to Woking, to an apartment me and Rio (my partner) bought together. And we're both enjoying it a lot, the process has been difficult, expensive and stressful. But we are here, and the more interesting project starts, settling in, and developing ourselves as people, and as a couple.
There are many things I want to do, and it very much feels like the end of an era, and the beginning of the next one.
I'd like to thank a few people.
- Rio, you have been nothing but amazing in everything. You're the best partner I could ever ask for, and I'm truly grateful for you. I hope that we continue to bring out the best in each other, and live out the rest of our lives together.
- Mum, you've provided for me for 22 years. It is because of your solid foundations that I was able to push myself through school, college and then university. I couldn't even begin to work hard if it wasn't for your extreme effort to give me these opportunities.
- Stephen, Mum did most of the work but I'm not sure the last stretch would be possible without you. I lived at home all my time at university, and you helped provide a stable environment for me, where I got the grades and my first real job. Much of my professional and personal development is down to your help.
There are many more people that have helped me, so in no order here are the rest: Marcos, Henri, Marne, Mat, and the countless others. Thank you to all of you and every friend and family member I haven't listen, you are all important.

View File

@ -0,0 +1,61 @@
+++
title = "Taking Accountability"
tags = ["software"]
date = "2025-11-17"
author = "John Costa"
toc = true
+++
There is an interesting shift that happens when you transition from a _junior_ to a more senior level engineer (or any other career for that matter).
> Note: You've probably met 40 year old _juniors_ and 20 year old _seniors_, age has some correlation, but less than you'd expect.
I've had a self-driven approach to work for many years. I started my own company when I was just in my first year of uni. I was self employed for quite a few years (tutoring), and I've worked on multiple software projects with other people.
But work is different.
Back at [Decipad](https://github.com/decipad/decipad) (my first _real_ job), I was a junior. Sure, I knew how to code but did I know how to be an engineer? I didn't.
As months past I got very good at being self driven. From figuring out what the product needed, to discussing it with the team, to implementing it, to delivering it, to maintaining it. This is something I am very grateful for having the freedom to do when I was working here.
Now that I am at [Requesty](https://requesty.ai), I've had to relearn this.
## Everyone is a junior when they first join.
OK. Maybe that's not true but stay with me.
When you first join a software project, you don't really know what's going on. You don't fully understand the customers, you don't fully understand the product, and you certainly do not fully understand the code. So what can you do?
You can do tasks. And ask (many) questions.
You shouldn't be responsible for the full delivery of a brand new feature the moment you step foot through the door. Your job should be to learn as much as possible. Contributing will come.
## Take Accontability
When you're more established, you understand this new place a little better, then you need to turn your engineering brain fully on. You need to understand that you are not here to be a ticket crunching machine. You are an engineer!
What do I think an engineer (in a software company) is? Well, it's someone who writes the code, tests it, makes sure it goes into production without breaking other parts, makes sure it actually works, makes sure it was worth building in the first place, goes back to improve existing code and infrastucture, someone who can talk about the business requirements and the more abstract concepts surrounding the code they write (or tell an LLM to write).
The reason I'm writing this blog post is because this part is hard.
Writing code is many (maybe all?) engineers confortable place. We like writing our tests, watching the screen go green as we make them pass. We like taking some code and refactoring it to look nice and pretty. (At least I do).
But then what?
You must go beyond this. You need to lead the way. You shouldn't be just the tool your manager uses to spit out code. You should be the person your manager delegates to, to fully build something.
How does this have to do with accountability?
If no one is telling you what to do, or how to do it, what do you do?
It's not easy, and often we are not as self monivated as we would like to be (I know I sometimes lack in this regard). But you need to turn your engineering brain on, and figure things out. You need to know what to do next, and how it will impact the business and other people around you.
It isn't enough to sit back and write code. That code needs to be in the hand of customers, it needs to be tested, it needs to be deployed, maintained, it needs to be designed. It needs love and attention.
## My conclusion
Take accountabiliy for your projects at work. You need to be able to lead from start to finish. You cannot wait for someone to tell you what the next step is. You need to figure out that next step.
Now, I talked a lot about you, but I must stress. If you cannot go to your team to share opinions and ask for help, then you need to leave whatever company you're working for. We're very much shaped and pushed by those around you. And part of this concept is that you need to help others too, in a funny way, you need to know when to help others!
Writing code isn't enough. Be an engineer!

View File

@ -0,0 +1,109 @@
+++
title = "The importance of loose coupling"
tags = ["software"]
date = "2025-02-05"
author = "John Costa"
toc = true
+++
Recently at work, I was faced with creating a system that needed to integrate between two very big modules of code. These two modules are practically our entire product at [Decipad](https://decipad.com). And when you have to integrate such big parts of code, it might be tempting to do it, and test by running the server and click around in the browser (in this case, our product is a web app).
However, I didn't want to continue this pattern (we had some code that integrated these two systems, but in a heavily coupled way), and therefore I set about with a slightly different approach, and when I was done I had a much greater appreciation for interfaces (and higher order functions).
## The Problem
I need to pass information from one module (the `Editor`), to another (the `Computer`). I also need to keep some state, and do some comparisons.
Let me illustrate what I wanted to achieve by writing some pseudocode, in a non-testable way.
```ts
const setup = (computer: Computer, editor: Editor): void => {
editor.on('some-event', (e) => {
const proccessedEvent = processEvent(e); // Some function
computer.push({ ...somethingComplicated, x: processedEvent });
});
}
```
If I wanted to test this part of code, I would have to create an instance of both of these two modules. This isn't the easiest approach, because the integration I needed would have to do some pretty heavy setup for tests, which would mean the test would mostly be boilerplate, not to mention unpredictable, as these two parts of code come with a huge amount of potentially buggy code.
This is a simple enough function - and at first - it is tempting to just wire it together and move on, however, in my case I also needed to keep track of some state to avoid pushing to the computer too often.
```ts
const setup = (computer: Computer, editor: Editor): void => {
const state = new Map<string, Event>();
editor.on('some-event', (e) => {
const proccessedEvent = processEvent(e); // Some function
const existingEvent = state.get(e.id);
if (someComparison(existingEvent, e)) {
computer.push({ ...somethingComplicated, x: processedEvent });
state.set(e.id, e);
}
});
}
```
This function still looks fairly innocent, but you can see the growing complexity. In order to test in isolation that my state mechanism works, I would need to setup an entire editor, an entire computer and then I would have to use this event system through the editor in order to test my function. This might be OK in an integration test where you want to test groups of systems, but as a unit test to test the individual logic of this function, it isn't ideal.
## Only use what you need
I don't want to pass the whole computer and the whole editor to this function. Instead a better approach that would allow me to test this in a much better way, is to instead pass an event emitted (or some other interface), and instead of the computer, I could pass a higher order function. This way I no longer need an editor or a computer to test this code.
```ts
const setup = (onEventChange: (e: Event) => void, eventEmitter: EventEmitter) => {
const state = new Map<string, Event>();
eventEmitter((e) => {
const proccessedEvent = processEvent(e); // Some function
const existingEvent = state.get(e.id);
if (someComparison(existingEvent, e)) {
onEventChange(e);
state.set(e.id, e);
}
});
}
```
You can even go a step further and remove the events all together by returning another higher order function, this way your function doesn't have to deal with `EventEmitter`, but instead with only `Event`.
```ts
const setup = (onEventChange: (e: Event) => void) => {
const state = new Map<string, Event>();
return (e: Event) => {
const proccessedEvent = processEvent(e); // Some function
const existingEvent = state.get(e.id);
if (someComparison(existingEvent, e)) {
onEventChange(e);
state.set(e.id, e);
}
};
}
```
Now this function has been boiled down to it's main purpose, to perform some action when an event has changed based on some state. You can then test this code very easily like this
```
const emittedEvents = [];
const eventHandler = setup((event) => emittedEvents.push(event));
eventHandler({ ...event1 });
eventHandler({ ...event2 });
expect(emittedEvents).toMatchObject([...whatever you want])
```
This way, our tests can focus on the fundamentals, and for the future they can easily show another programmer what the test is focusing on, rather than have them looking at a tone of boiler place. This test will also run a lot faster than if you have to do a tone of setup, although I don't think this is a huge priority.
## Conclusion
It may be difficult to not reach for the solution straight away, as I mentioned the first function I showed is fairly simple and easy to understand, but it isn't testable, and it is heavily coupled.
When you're programming a solution, think about what you're trying to achieve with a specific function, or a specific module, and try and work out the best interfaces and parameters to give this function. A good rule of thumb that I've started using is figuring out how I'd like to test the code, and what I'd like the tests to show, this can lead you to a solution fairly quickly.
This isn't new of course, all I've talked about has been established in software engineering for decades (I've sort of described dependency injection, and interfaces), but it is interest when we see these best practices in our code, and it's exciting to see why they work, it makes programming much more fun for me, because I don't have to keep a massive amount of information in my head (the editor and the computer), but can instead focus on what is right in front of me.

View File

@ -0,0 +1,78 @@
+++
title = "The year of the Camel - Advent of Code 2024"
tags = ["software", "Advent of Code"]
date = "2024-11-28"
author = "John Costa"
toc = true
+++
## TLDR;
I will be doing the advent of code in Ocaml this year.
I've been doing the advent of code since I found out about it in 2019. It's been an exercise that has me reflecting on my growth and development as an engineer, and taken me through many stages in life.
# 2019. The first year.
In 2019, when I first started the challenge, I only completed 4 days. At the time I was in my second year of [Sixth form](https://en.wikipedia.org/wiki/Sixth_form), and had gathered some proficiency in Java, which was the language of choice for my school. However, I did these 4 days in JavaScript and Node.js, as during extra curricular programming clubs, we had been taught JavaScript for game development, where we used it to develop simple 2D games on an HTML canvas, and the more interesting part to me, creating servers using JavaScript, with the infamous Node.js.
Little did I know at the time how much JavaScript and Node.js would shape my career, and although I have strong opinions about both of these tools, I cannot deny that they drove my passion for building things.
# 2020. The tryhard year.
In 2020, I was at home, like most university students were. At this point I was a first year at Royal Holloway studying Computer Science, where the language of choice for learning was also Java.
I didn't find the first year very challenging and being at home I felt even worst, so I look back to December of this year quite fondly, as during a time where I was mostly alone, and with little to do other than work (I had begun my private tutoring career), I spend most of my time doing the advent of code. I managed to stay in the race until day 20.
This marked the start of something great. A love for programming I had previously kindled had now ignited. And from here on out I would spend most of my time behind a screen, typing away, at algorithm problems, and endless side projects.
I have gone back to this year and nearly finished it (I currently sit at 47 stars). This was a very special one for me.
# 2021. The VIM year.
During my second year, I had less time to go deeper into the advent of code. However I still managed to go on until around day 12.
The goal for this year was twofold. I had been loving Golang, having learnt it for a few side projects, and I would still pick this language most of the time. But the main goal wasn't to complete a few days with Golang, it was to only code in VIM - and not some emulator - no, I had to use the terminal VIM, with very little thrills (although I did setup the LSP).
I again look back on this time, because I knew little more than to go into insert mode and just use a keyboard normally. I started to pick up the more complicated keystrokes and some cool motions.
I know use Neovim to develop, and for me, it is the best development setup. I am the most productive, and the most comfortable, when inside a terminal.
# 2022. The TypeScript year.
I had just started my internship at [Decipad](https://decipad.com), where we use TypeScript for every part of the tech stack. And I had enjoyed it.
I was quite a hold out on the TypeScript movement, I didn't see why we needed it. I was more than happy to just use JavaScript and did so for a very long time (even during this period, I used JavaScript for my second year project's frontend).
It wasn't a dislike for static typing, it was simply a matter of not enjoying bloat. To me, it felt weird that we would develop in a language, compile down to JavaScript, and then run said JavaScript. This I know see as a necessary evil, as JavaScript is so very difficult without types (at least on larger codebases).
So I decided to use TypeScript, it was the tool I used for work, so I extended that to my leisure. And it went great. I managed to until day 16, where I stopped as work was ramping up, and I had been put into difficult positions at work, to solve difficult challenges.
# 2023. The Zig and YouTube year.
This year I took it to another level. I had learnt some Zig and completed a simple implementation of [Huffman Encoding](https://johncosta.tech/projects/huffmanz/), but I wanted to learn more about this language. I also wanted to continue working on my [YouTube Channel](https://www.youtube.com/@johncosta27/featured), something I enjoyed whilst working as a tutor.
So, everyday I would sit behind the monitor and record myself walking through the problem in a language that is quite difficult. This took a lot of time and dedication. And I would slow down around day 12, but would periodically post a video. I believe I managed 34 stars during December, and throughout this year, I have gone back and finished off the ones I didn't manage to do at a time. With most of them being on YouTube as well.
After a year of on and off work on it, I finally finished an entire calendar of the advent of code. All 50 stars.
This grew my following a fair chunk to 160 subscribers, and I managed over 1k views on the day 1 video, which is pretty fun.
# 2024. The year of the Camel.
Throughout my time as an engineer, I have always written in imperative-like languages (Java, JavaScript/Typescript, Golang, Zig), and I lack functional experience.
During my last year of university, I had learnt Haskell. It wasn't an extensive course but it was enough to be familiar with the concepts of a functional language. I got enough of a taste to understand why functional languages are an important skill, even if you don't use them in your day to day life.
I have also enjoyed listening to Jane Street's Podcast - [Signals and Threads](https://signalsandthreads.com), where a variety of extremely impressive and interesting engineers talk about Ocaml, from using it in their day to day work, but also from their Compiler's team. These episodes still feel like action movies to me.
My best grade at university was in my Compilers module, taught by [Elizabeth Scott](https://pure.royalholloway.ac.uk/en/persons/elizabeth-scott), who's teaching style and expertise has made me so fascinated by compilers. I achieved an 88% in her class, with my best exam result at university of around 93%.
For this reason I want to explore different languages, understand their syntax choices and the different perspectives an engineer must deal with when faced with functional ML-style languages.
Another professor of mine, Dave Cohen, often said "If you learn another language, you will become better in both". He was refering to learning SVN alongside Git, but the quote still applied everywhere else, and I completely agree with him.
For these reasons, I will do the advent of code in Ocaml this year.
Ocaml is a functional language, similar to Haskell, but a little less hardcore (and actually used in the real world ;) ). It has an impressive community, incredible tooling and a syntax that is not so restrictive if you want to write simpler code. Making it a great stepping stone.
I will also be recording my attempts to YouTube, where you will be able to watch me stumble over myself many times. I hope to see you there.

View File

@ -1,4 +1,3 @@
+++ +++
title = 'Blog' title = 'Blog'
date = 2023-11-14T17:55:14Z
+++ +++

42
content/blog/requesty.md Normal file
View File

@ -0,0 +1,42 @@
+++
title = "Requesty."
date = "2025-07-07"
tags = ["software"]
toc = true
+++
I will be joining [Requesty](https://requesty.ai) in August. My time at Decipad is coming to an end. I want to describe what I'm feeling, what I'm hoping for in the future, my apprehensions, and what I'm looking forward to.
# 3 Years (What I'm feeling)
Decipad has been the start of my professional career. Even though I had worked at other places before - and even founded my own company - Decipad was the first time I worked, as part of a sizable engineering team, to build a product.
I was hired by [Nuno](https://www.linkedin.com/in/nunojob/), who I regard as one of the kindest, most inspiring and decisive people I've ever had the pleasure of meeting. I hope that our paths cross again, and if not I will forever regard him as a friend and role-model.
I learnt how to work as a team, I learnt how to make product decisions, I learnt how to talk to clients. I came into Decipad as a hot-shot programmer, I could crunch tickets like a machine, but could I steer a very new product the correct direction? No, I could not.
I leave Decipad feeling that I can make those decisions, I am able to steer a product the correct way. I am not just a coder, I'm a product engineer.
I met lot's of amazing people - too many to list - and for all of them I am thankful for your kindness and patience as we went on this crazy journey together.
# My Senior Arc (What I'm hoping for the future)
I am joining as the 2nd hire, a Founding Engineer. This role caries a lot of weight, I am not just an employee of the company, I will be someone who will shape the product itself. work hand-in-hand with the founders to build the best developer experience, the most reliable and performant way to interact with LLMs from your codebase.
Like always, I have a lot to learn. I am hoping to learn from [Daniel](https://www.linkedin.com/in/daniel-trugman/), but I'm also hoping he can learn from me, and this I believe is the key difference from when I started Decipad. I am now a more complete engineer, and I am able to lead, much more than when I started at Decipad. I hope to bring my skills as an engineer and as a product person to the team.
This will likely be the hardest job I've ever worked. The area is hard, the space is crowded by already incredible people and products, and the hours will be long. It took me a while to decide that this is what I wanted to embark on, I deliberated over it for many days (I had other offers, that would potentially be more relaxed, Series A start-up). I want to be the person to take these opportunities and difficulties and face them head on with a smile. And do that I shall.
# What I'm scared of (Apprehensions)
I feel nervous, but OK with the difficulty of the technical challenges ahead of me. I enjoy the space, I know a fair bit about it already, and I will learn more everyday. What I am not so confident in, is my physical ability to join an in-person team, with high uncertainty, and a growing customer base. These are very rational fears, and I am working on having control over them, but it will take a while. I am taking the time from now to my start date, to prepare myself for what's about to come.
# What I'm looking forward to
Honestly, Golang. I've used this language so many times in so many projects - and yes I know it is [flawed](https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-ride) - I still get much joy from writing it. I am also looking forward to working on a service which is mostly non-user facing. Requesty does provide a very lovely dashboard, but the people actually using our core service (The router), are people who will never see into requesty.
I am super excited to build these systems, focusing on: high availability, high scalability, and performance. I guess I'm saying I'm looking forward to being a backend engineer.
# Conclusion
I'm moving jobs. I am really excited, and hyped to write code. More than I have been in a long time. I will enjoy this month before I start, and make sure that I am up to the challenge.

View File

@ -0,0 +1,30 @@
+++
title = "Self Hosting"
date = "2025-06-08"
tags = ["self-hosting", "software"]
toc = true
+++
Since I moved into my [flat](https://en.wikipedia.org/wiki/Flat#Architecture), one of the first things I bought was a used computer which I could use as a server. This cost me £50, and it's not a very powerful machine. But this tiny machine has been a great source of fun for me. I want to break down what I'm doing with my own machine, but also the philosophy of self-hosting, and taking back control over your data, and deployment processes.
# Cloud can be bad
For many use-cases, using the cloud to host your projects, can be more trouble than the ol' server under the desk. I run mustly outward facing services on this machine, with some users and the service is very similar to what I would get if I hosted it on a VPS or some managed service. I don't get many [nines](https://en.wikipedia.org/wiki/High_availability#%22Nines%22), I probably only get 1 (or 2 on a good streak!), but does it really matter?
- My most important service is the backend of Haystack. A project in a closed beta which allows users to upload pictures. If the service goes down, then my users lose the ability to view, and process their images, which is obviously a bad experience.
- I have had one outage (my fault, skill issue), which lasted a day. And I argue that this doesn't matter, realistically Haystack is and will always be a small project with few (but interested) users. One where I believe 1 or 2 nines is enough.
So I've mentioned the downside, availability. But what are the good things?
- Money. I paid very little for the server, but for a similarly speced VPS on most cloud providers I would be paying 72$ a month!! [Source](https://www.linode.com/products/dedicated-cpu/). I do have other costs, namely electricity (I don't have a good number for this, but with the CPU averaging 10% usage, I don't think it's massive), and internet (which I would pay for regardless). There is a good amount of money to be saved by having an old computer under your desk running your stuff.
- > I will counter myself though. I will end up upgrading this server, as self-hosting is very much a hobby (and an expensive one when you start playing with fancy hardware!)
- Ownership. No one will take away this server from me. The data stored on it, is controlled by me, and not some giant corporation. This becomes important when it comes to personal data. Which I will talk about now.
# Own your data
Self-hosting isn't just for hosting projects, and outward facing services. Most of my time is spend on inward facing services. I've talked about services I host on the [Gitea post (https://johncosta.tech/blog/hello-gitea/), but to summarise, I have a lot of personal data from myself and my partner, which I would rather control rather than give it up to Google or Apple. A good example is my [Immich](https://immich.app) instance, which has all my photos, and these are terrabytes worth.
In today's age, it is important we all think about our personal data, who has control over it and who stands to profit from it. I don't want to be training data for an LLM without my consent.
# Learning and Enjoyment
Most importantly, I just love tinkering with the server. I love staying up to date with new open source projects which you has host yourself, I love having little home automations that run on my own hardware (my office lights are controlled by a really single Go script and a WLED controller).
I've also learnt so much about server administration and DevOps. I've learnt a lot about observability, about hosting your own CI/CD, and how to know when things have gone wrong. I've also continued to learn about Linux, networking, and so many other things I would love have a chance to play with, unless I had my own server. You can argue that this is possible with a VPS, but really, where's the fun in that?
# Conclusion
Self-hosting is really fun, you should try having an old computer under your desk running your stuff. You get a sense of accomplishment, for learning all you need to make it work, and to then manage it such that it continue to work. You will also be able to do things you never thought about doing, like hosting your own Netflix with [Jellyfin](https://jellyfin.org), or having actual production services running right next you, and managing your own database. I've really enjoyed it, and will continue to enjoy it for years to come.

View File

@ -109,7 +109,7 @@ I've talked about the book as a whole and the key lessons I have taken from it (
## [Obsidian](https://obsidian.md) ## [Obsidian](https://obsidian.md)
This is the champion of the entire system. I use other tools but this contains most information. This is the champion of the entire system. I use other tools but this contains most information.
![[Pasted image 20240616115501.png]] ![Obsidian Menu](/obsidian_menu.png)
There are two reasons why I choose Obsidian, not only as the best option, but in many ways _the only option_. There are two reasons why I choose Obsidian, not only as the best option, but in many ways _the only option_.
@ -133,13 +133,13 @@ Here are some that I use.
A really powerful thing you can do with Dataview, is bringing tasks from across various files. A really powerful thing you can do with Dataview, is bringing tasks from across various files.
![[Pasted image 20240616120232.png]] ![Tasks](/tasks.png)
This alone means that I no longer need a todo app or a project manager, because this is plenty for me. This alone means that I no longer need a todo app or a project manager, because this is plenty for me.
Mapview is also really useful so I can store all the places I have been to, and check what I thought about them. Here is an example from a recent trip to Barcelona. Mapview is also really useful so I can store all the places I have been to, and check what I thought about them. Here is an example from a recent trip to Barcelona.
![[Pasted image 20240616120358.png]] ![Map](/map.png)
## [Raindrop](https://raindrop.io) ## [Raindrop](https://raindrop.io)
@ -174,4 +174,4 @@ Forte is a very good writer, with many practical chapters focused directly at ge
I highly recommend you read it yourself, even if you skip a bunch of chapter to just look at CODE, this is the best resource to learn about it. I highly recommend you read it yourself, even if you skip a bunch of chapter to just look at CODE, this is the best resource to learn about it.
Rating: 8/10. Rating: 8/10. e

View File

@ -0,0 +1,5 @@
+++
title = "The 7 Habits of Highly Effective People"
author = "Stephen Covey"
date = "2025-07-22"
+++

View File

@ -0,0 +1,4 @@
+++
title = 'Books & TV'
date = 2025-07-22T15:15:00Z
+++

View File

@ -0,0 +1,78 @@
+++
title = "Sedated - By James Davies"
date = "2024-06-02"
tags = ["books"]
toc = true
+++
Sedated is a book about mental health, and the increase is mental illness in recent years - and with that the increase in anti depressants and other psychoactive drugs.
The books revolves around a question. 'If we have increased anti-depressant usage, why are we seeing an increase in mental illness?'. Davies has two ways of answering the question.
1. Anti-depressants are not effective at treating depression.
2. Our economic system increases the amount of people with mental illnesses.
# Are anti-depressants a lie?
Davies presents some very convincing sources, coming up with the conclusion that long term use of anti depressants is almost always detrimental to the user, and even short term use is more often harmful than helpful. The withdrawal from these drugs is also a lot more brutal than the pharmaceutical companies states.
> So why do we use them so much?
## The expansion of mental illnesses.
There is a book called **The Diagnostic and Statistical Manual of Mental Disorders**, it contains all the known mental disorders. Interestingly, the researchers who approve new entries onto this book are often funded by pharmaceutical companies - not only that but the bar required to constitute a mental disorder is really low.
Almost every aspect of human personality can come down to a distorter, every single aspect of a persons emotions can be described by this book in some form of _disease_. From this we can conclude a few things.
- We have expanded the definition of mental disorder, to a point where it no longer means all that much.
- People with perfectly normal personality traits will now be described as mentally ill.
And who wins with all the over-diagnosing?
## Big Pharma and privatised suffering.
We live in a Neo-liberal society, the Chicago School of thought. We allow markets to do what they want with minimal government restriction. Because of this freedom, companies were able to privatise suffering.
We can now buy anti-depressants, to cure the suffering and therefore making money if people are worst off mentally.
Not at all surprisingly, most research that promotes the use of anti-depressants, come out of the research sponsored or conducted by the very companies that manufacture the drugs. The research is often very shaky as well, if not just outright wrong.
This is not to say that the use of anti-depressant is never justified, it is simply stating that many powerful companies benefit if we constantly consume the drugs, for a long time, therefore lowering the barrier to entry is an important goal for them (even if they'll never say it is).
## It is your fault.
This book doesn't just talk about mental illness, it talks about the economic situations which give a rise to not just mental illnesses, but the expansion of this umbrella.
If a person is stressed at work, or suffering from workplace dissatisfaction, it must because because they are not good at managing their time, socialising with co-workers, or doesn't champion the mission of the company. It seems that, today, it is simply not good enough to say that you are dissatisfied with your work, there must be something wrong with you.
- You must be suffering from depression or anxiety.
- Your attitude is incorrect and must be medicated and changed.
- It is simply, your fault.
We don't dare question the atmosphere around us, we don't ask. Is it that the workplace is toxic? Is it that the work feels meaningless? Is the commute not too long? These questions go unanswered, and to _cure_ you, you are medicated, to restore some mythical balance.
Anti-Depressants have become a quick fix to get workers back to work, to allow people to bare the work they do, and it can never be the jobs fault, it must be the individual's fault.
This is one of the reasons for the rise of a type of therapy called CBT (Cognitive Behavioural Therapy). Although I appreciate this type of therapy, and it is useful in helping reshape negative thought patterns, it however shifts the blame to the individual. It's your thoughts that are wrong, it's you who is at fault and who must change and be medicated.
The author made this point extremely well, I started noticing this pattern in many places, from government mental health policy, to NHS therapy. It is really quite concerning that individuals are no longer considered in the mental health debate, but only their usefulness as an economic contributor.
# Conclusion
I am quite concerned about the statistics. The number of adults in the UK who have taken anti-depressants in the last year is 25%. And this is not likely to slow down any time soon.
How long can we go before we have people permanently our of work because they've had enough? And their body simply cannot take anymore?
The rise in the number of people who do not work due to physical and mental disabilities has risen a lot in the last few decades, and I not in any way think that people have become softer, I think these are genuine cases of people becoming disabled because of a very harsh situation that we all go through.
I don't think that Anti-Depressants are bad, or that we are prescribing them to give money to Big Pharma, no. It is a quick fix, a get healthy quick scheme, but one that is extremely short sighted, the long term risks of constant consumption of these drugs will be much worst than the short term positive that people can get back to work.
The book has made me question how we think about mental health, and generally I think we are moving in a _better_ direction, and being more open about it, specially in the workplace. But we must do more. We must stop prescribing anti-depressants as if they are candy, and use them only _after_ therapy has been tried. Therapy has been shown to be extremely effective when done for a few months. But therapy is more expensive than a few pills. I truly don't know what the answer is.
Gloomy conclusion, but a needed one. The world can be harsh, but we are richer than we have ever been, now more than ever we can tackle these problems now that almost everyone's basic needs have been met. We can move on to solving these _first_ world problems.
Thank you for coming to my TedTalk.
## Rating
I would give this a good 7.5/10.

6
content/gists/_index.md Normal file
View File

@ -0,0 +1,6 @@
+++
title = 'Gists'
toc = true
+++
Small snippets, random thoughts, bits of code. Anything really.

View File

@ -0,0 +1,49 @@
+++
title = "Pointer vs Value"
date = "2025-11-24"
author = "John Costa"
tags = ["Software", "gist"]
+++
When working with pointers, what do you think the difference is?
## 1. Assign to pointer
```go
func (c *MyStruct) SomeFunction(val any) {
parsedStruct := someProcessingFunc(val)
c = &parsedStruct
}
```
vs
## 2. Assign to value
```go
func (c *MyStruct) SomeFunction(val any) {
parsedStruct := someProcessingFunc(val)
*c = parsedStruct
}
```
I came across this at work today and it took me a second to figure out what was wrong.
## Number 2 is correct
The first example actually assigned the pointer of `parsedStruct` to the local variable `c` which itself is just a pointer.
```go
c = &parsedStruct
```
All we've done, is reassign a local variable.
Whereas:
```go
*c = parsedStruct
```
Actually changes the underlying value of the pointer `c`, and changes it to the content of `parsedStruct`.
It's easy to overlook these things, specially now when LLMs write more and more code. But it will be more and more important to understand and spot these differences, they might cost you or your company a lot of business.

View File

@ -0,0 +1,11 @@
+++
title = "Advent of Code"
date = "2024-11-28"
author = "John Costa"
toc = true
tags = ["Software", "Advent of Code"]
+++
Git Repo: https://github.com/JohnCosta27/AdventOfCode
I'm a massive fan of the Advent of Code, I have created a big mono repo of all the years solutions.

View File

@ -0,0 +1,16 @@
+++
title = "Real Time Trading system"
date = "2024-11-17"
author = "John Costa"
toc = true
tags = ["Software"]
+++
- Git Repo: https://github.com/JohnCosta27/RealTimeTradingSystem
- YouTube video: [https://youtu.be/OlzLp7X_UnY](https://youtu.be/OlzLp7X_UnY)
During my final year at university, I developed a real time trading system as a way to explore distributed systems development.
I built a modular architecture that enabled horizontal scaling, and implemented various strategies for speeding up the application.
You can also check out my final report [here](https://github.com/JohnCosta27/RealTimeTradingSystem/blob/main/final_report.pdf).

View File

@ -9,9 +9,19 @@ theme = 'risotto'
[[menu.main]] [[menu.main]]
name = 'Blog' name = 'Blog'
pageRef = '/blog' pageRef = '/blog'
weight = 1
[[menu.main]] [[menu.main]]
weight = 1
name = 'Projects' name = 'Projects'
pageRef = '/projects' pageRef = '/projects'
[[menu.main]]
weight = 20
name = 'Books & TV'
pageRef = '/books-and-tv'
[[menu.main]]
weight = 10
name = 'Gists'
pageRef = '/gists'
[params.about] [params.about]
title = "John Costa" title = "John Costa"
@ -25,19 +35,34 @@ palette = "tokyo-night-dark"
# * FontAwesome 6 <https://fontawesome.com/> ('fa-brands', 'fa-normal', or 'fa-solid' for brands) # * FontAwesome 6 <https://fontawesome.com/> ('fa-brands', 'fa-normal', or 'fa-solid' for brands)
# * Academicons <https://jpswalsh.github.io/academicons> ('ai ai-') # * Academicons <https://jpswalsh.github.io/academicons> ('ai ai-')
[Author]
name = "John Costa"
email = "me@johncosta.tech"
[[params.socialLinks]] [[params.socialLinks]]
icon = "fa-brands fa-github" icon = "fa-brands fa-github"
title = "GitHub" title = "GitHub"
url = "https://github.com/JohnCosta27/JohnTech" url = "https://github.com/JohnCosta27/JohnTech"
[[params.socialLinks]] [[params.socialLinks]]
icon = "fa-solid fa-envelope" icon = "fa-brands fa-git-alt"
title = "Email" title = "Gitea"
url = "mailto:johncosta027@gmail.com" url = "https://git.johncosta.tech/JohnCosta27"
[[params.socialLinks]] [[params.socialLinks]]
icon = "fa-brands fa-linkedin" icon = "fa-brands fa-linkedin"
title = "LinkedIn" title = "LinkedIn"
url = "https://www.linkedin.com/in/john-costa-b883971b5/" url = "https://www.linkedin.com/in/john-costa-b883971b5/"
[[params.socialLinks]]
icon = "fa-brands fa-hashtag"
title = "Converge"
url = "https://converge.sh/1"
[[params.socialLinks]]
icon = "fa-solid fa-envelope"
title = "Email"
url = "mailto:me@johncosta.tech"
[taxonomies] [taxonomies]
tags = "tags" tags = "tags"

59
layouts/_default/rss.xml Normal file
View File

@ -0,0 +1,59 @@
{{- $authorEmail := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .email }}
{{- $authorEmail = . }}
{{- end }}
{{- end }}
{{- end }}
{{- $authorName := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
{{- with .name }}
{{- $authorName = . }}
{{- end }}
{{- else }}
{{- $authorName = . }}
{{- end }}
{{- end }}
{{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
{{- $pages := slice }}
{{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }}
{{- else }}
{{- $pages = $pctx.Pages }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo</generator>
<language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }}
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{- end }}
</channel>
</rss>

View File

@ -2,6 +2,10 @@
<html lang="{{- site.Language.Lang -}}"> <html lang="{{- site.Language.Lang -}}">
<head> <head>
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
<link rel="alternate"
type="application/rss+xml"
href="{{.Site.BaseURL }}/index.xml"
title="{{ .Site.Title }}">
</head> </head>
<body> <body>
@ -16,6 +20,9 @@
<div class="aside__content"> <div class="aside__content">
{{- block "aside" . }}{{- end }}{{partial "allTags.html" . -}} {{- block "aside" . }}{{- end }}{{partial "allTags.html" . -}}
</div> </div>
<div class="aside__content">
{{- block "aside" . }}{{- end }}{{partial "recentPosts.html" . -}}
</div>
</section> </section>
<footer class="page__footer">{{- partial "footer.html" . -}}</footer> <footer class="page__footer">{{- partial "footer.html" . -}}</footer>

View File

@ -0,0 +1,6 @@
<h2>Recent Posts</h2>
<ul>
{{ range first 5 (where site.RegularPages "Section" "blog") }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>{{ if .Date }}<p>{{ .Date.Format "2006-01-02" }}</p>{{ end }}</li>
{{ end }}
</ul>

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
static/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 KiB

BIN
static/obsidian_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
static/tasks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -1,3 +1,4 @@
<li> <li>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ $format := "02 Jan 2006" }}
<a href="{{ .Permalink }}">{{ .Date.Format $format }} | {{ .Title | markdownify }}</a>
</li> </li>

View File

@ -16,8 +16,8 @@ h3,
h4, h4,
h5, h5,
h6 { h6 {
font-size: 1rem; font-size: 1.2rem;
margin: 1.5rem 0 0 0; margin: 2rem 0 0 0;
font-weight: 600; font-weight: 600;
} }
@ -36,7 +36,7 @@ h3 + h6,
h4 + h5, h4 + h5,
h4 + h6, h4 + h6,
h5 + h6 { h5 + h6 {
margin: 0; margin-top: 0.5rem;
} }
h1:before { h1:before {