RSSAmplifier

Blog

rockyourcode

Recent content on rockyourcode

rockyourcode.comRSS feed ↗25 posts

Latest posts

Use Anubis to Firewall AI Scraping

I have been using a self-hosted Redlib as an alternative front-end for Reddit. I like Redlib better than the original UI, as it is quite simple and doesn’t bother me with any popups. My instance is not private, so in theory, everyone can use it. As I do not advertise my instance, the traffic on my server was negligible. However, lately AI scrapers seem to have discovered my instance. That…

Use Local LLMs With Zed Dev Editor

Lately, I wanted to see if I can run a local LLM on my Macbook Air M2 and to use it as a provider for the Zed editor . tldr; it works but is slow. You probably need a more powerful machine. (I have since moved to OpenRouter as my provider, however that is not a local option.) Run a Local LLM I use LM Studio . Make sure to install the binary into the standard /Applications/ -folder if you’re…

Testcontainers With Orbstack

Lately, I needed to run testcontainers with Orbstack . Unfortunately, running my integration tests with dotnet test yielded the following error: System.AggregateException One or more errors occurred. ( Docker is either not running or misconfigured. Please ensure that Docker is running and that the endpoint is properly configured. You can customize your configuration using either the environment…

I Use Devbox and Direnv for Local Development Now

I am currently developing a Go REST API . I need an environment variable in my shell for the database connection string. I also need to install a Golang package for SQL migrations. However, I do not want to pollute my machine. I hate to install the package globally just for this one use case. Do I want to set my env variable globally? No! But if I only set it temporarily, I need to repeat that…

Scheduled Deploys for Netlify Builds

I want to trigger a re-deploy of my Hugo blog which is hosted on Netlify . In the past, I’ve successfully used ifttt with a webhook. Unfortunately, they’ve stopped supporting the webhook feature on the free tier. What’s the solution? Netlify has a tutorial on how to use serverless functions for automatic deploys. Here is the concise tutorial with a few steps added which…

How to Set a Vite Proxy to Your Backend

I’m currently working on a Vite React application with a Nest.js backend. The React app runs on localhost:3000 and the backend on localhost:4000 . When I query the backend from React, I get a CORS error. After unsucessfully trying to enable cors for local development, I’ve gone back to using a Proxy setting in my vite config . This behavior is similar to Create React App’s proxy…

I Want to Like Helix, But...

I’ve been using the Helix editor for a while now. At first I was confused by how the word motions worked but overall it was a good experience. Helix’s biggest selling point is that it works right away. Setting up LSP support is very easy since no plugins are needed. Helix also has multiple cursors which I’ve come to like for editing multiple lines comfortably. In Vim you can work…

Working With C# on Macos M1 (Helix, Rider)

I want to get into C# development, because my future project will likely be in C#. I wanted to use Rider , a JetBrains product. I am using IntelliJ (the flagship JetBrains IDE) at my day job, and I find it more powerful than VS Code. I had a bit of difficulties to get Rider working on macOs. My alternative editor right now is Helix , a terminal editor. There were also some small hiccups with…

Nextjs 13 With Prisma (MySQL) Planetscale and Vercel

In the last two weeks I’ve been hacking away on a Next.js 13 application to learn more about React server components. I have used Prisma with a local Postgres database for development. I normally spin up my databases via docker. When it came to deployment, it was easy enough to throw my app on Vercel, but I have been trouble finding a good free offering for Postgres. In the past, I have used…

Update Gulp to Use ESM

I built my personal website in Eleventy a few years ago. For this, I followed a course called Learn Eleventy From Scratch . A couple of years ago, Eleventy made a big splash as a simple JavaScript framework to build static websites. Nowadays, Astro is probably more popular, but I have been happy with Eleventy so far. My Eleventy site has a Gulp pipeline to optimize images, get fonts, and transform…

TIL: Insert Macros for the Helix Editor

I’ve been using the Helix editor for two weeks now as my daily driver in my personal coding projects. Helix is a modern terminal text editor that’s quite capable as a tool for writing code. A Kakoune / Neovim inspired editor, written in Rust. Features Vim-like modal editing Multiple selections Built-in language server support Smart, incremental syntax highlighting and code editing via…

Kickstart Your Neovim Journey With kickstart.nvim

I’ve been curating my Vim config for several years and it has blown up to several files and a lot of obscure settings. My Vim config is my own , a very individual piece of software that fits my preferences when it comes to text editing. Since NeoVim 0.8, the Vim fork has introduced new groundbreaking features that allow for smarter autocompletion and language server support. Lua has also…

How to Download HTML Elements as PDF

As software developers, we often come across situations where we need to provide users with the option to download HTML content as a PDF document. This capability can be especially valuable when we want to enable users to save web pages, reports, or other dynamically generated content for offline use or easy sharing. In this article, we will explore how to accomplish this using jsPDF, a widely…

Use CSS Grid for Decorative Elements

I learned this trick in Rachel Andrew&rsquo;s workshop . HTML: < h1 >My heading</ h1 > CSS: h1 { display : grid ; grid-template-columns : 1 fr auto 1 fr; gap : 1 em ; } h1 :: before , h1 :: after { content : '' ; border-top : 1 px solid black ; align-self : center ; } In the code example provided, we can see how CSS Grid is used to style a heading. The &ldquo;h1&rdquo; element is selected in the…

Use @Hostbinding to Access CSS Variables in an Angular Component

Last week, I needed to access a CSS variable in an Angular template to configure a Chart.js chart. You can use @HostBinding to achieve this. What is @HostBinding ? @HostBinding is an Angular decorator that allows developers to bind a directive property to a host element property. It is used to set a property value on the host element of a component, in this case the component&rsquo;s root element.…

Angular Workspaces as Alternative to Nx Monorepo

Today I learned that you can create monorepo workspaces with Angular . I&rsquo;ve always used nx , but if you don&rsquo;t want to use a third-party tool, the built-in Angular capabilities might be enough. Angular Workspaces ng new my-workspace --no-create-application cd my-workspace If you use pnpm : pnpm dlx @angular/cli new my-workspace --no-create-application --package-manager pnpm cd…

Creating a Smooth Fade in Fade/Out Animation Effect With CSS

Have you ever wanted to gradually float a toast message into your screen? One way to do this is by adding an animation effect, and a fade-in/fade-out transition is just the thing I needed. In this article, I want to show you how to create a smooth fade-in/fade-out effect using CSS, with a faster fade-in time and a slower fade-out time. To create this effect, we can use the following code: .…

Maximize Learning at Conferences and Meetups

Here are some notes from the Youtube video Maximize Learning At Conferences & Meetups with Joe Eames with Brooke Avery and Joe Eames. What do community gatherings offer? The atmosphere creates a zeal that cannot be replicated from home. If you want to get better at something, get involved in the community. This creates opportunity. Some Tips: leave work at home stay and engage until they kick you…

Verify Your Online Accounts With Keyoxide

Keyoxide is a privacy-friendly t1. ool to create and verify decentralized online identities. Just like passports for real life identities, Keyoxide can be used to verify the online identity of people to make sure one is interacting with whom they are supposed to be and not imposters. Unlike real life passports, Keyoxide works with online identities or &ldquo;personas&rdquo;, meaning these…

Use Environment Variables With VuePress 2

For $DAYJOB I had to build a new feature for our internal VuePress 2 documentation. I needed to fetch data from an API that needs an API token. That&rsquo;s why I wanted to use environment variables to store the token, both locally as well in our CI pipeline . Surprisingly this was hard to figure out. It didn&rsquo;t help that I&rsquo;ve never worked with Vue.js or VuePress. The documentation was…

Notes on “Building a Pragmatic Unit Test Suite”

Here are some notes on the course “Building a Pragmatic Unit Test Suite” by Vladimir Khorikov. Goals and Guidelines Unit tests help with confidence : you know that changes don&rsquo;t break functionality. Not all unit tests are equal. Coverage metrics are problematic: you can work around them, for example, by writing assertion-free unit tests. Coverage metrics are a good negative indicator, but…

My First T3 App

tRPC is the hottest new thing in the TypeScript ecosystem: build end-to-end type-safe APIs without the overhead of GraphQL. tRPC is a protocol to expose a function of your backend to your frontend using TypeScript type definitions. No code generation required. You write both your backend and your frontend with TypeScript and share the types. tRPC is framework-agnostic. Create-t3-app is build on…

Write Better in Neovim With Languagetool

LanguageTool is a grammar tool and spell checker with an open-source core. I have used grammarly for a while, but the browser extension was crap. A colleague recommended LanguageTool (LT), and I&rsquo;ve been a happy user of the browser extension ever since. LT has superior support for other languages than English. It also features decent suggestions for improving your grammar. The free tier of LT…

TIL About GNU Stow to Manage Dotfiles

Today I learned about the tool GNU Stow , a free program that helps with managing symbolic links on your system. What does that even mean? I store my user configuration in a dotfile . Using Git, I can synchronize my settings across different machines. Now I have a backup, even if I lose my computer, or it breaks. So far, I&rsquo;ve used symlinks to create a link on my machine to the central git…

Helix Editor – 90% of Neovim With Kakoune

I&rsquo;ve spend too many hours setting up the recent NeoVim features (since v0.5): tree-sitter , nvim-lsp , nvim-cmp . Why? NeoVim&rsquo;s parser tool tree-sitter offers a better integration of language servers, syntax highlighting and auto-completion. The Problem Vim and NeoVim are great. However, I put a lot of effort into customizing these editors to my liking, so that I could comfortably use…