<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>haykot.dev</title><link>https://haykot.dev/</link><description>Recent content on haykot.dev</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 18 Nov 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://haykot.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>4 Tips for Working with sqlc in Go</title><link>https://haykot.dev/blog/4-tips-for-working-with-sqlc-in-go/</link><pubDate>Mon, 18 Nov 2024 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/4-tips-for-working-with-sqlc-in-go/</guid><description>This post shares 4 tips for effectively working with sqlc in Go. It covers handling bulk updates with parameterized queries, using CASE and NULL for conditional filters, and organizing query types across packages to reduce type pollution. These strategies help maintain clean and scalable code when using sqlc.</description></item><item><title>Ansible Workflows with Gitea Actions</title><link>https://haykot.dev/blog/ansible-workflows-with-gitea-actions/</link><pubDate>Wed, 03 Apr 2024 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/ansible-workflows-with-gitea-actions/</guid><description>In this post, we&amp;rsquo;ll look at how to use Gitea Actions to automate Ansible workflows including
linting and running the playbooks and some key gotchas when setting up the workflow</description></item><item><title>Pluggable Architecture in About 300 Lines of Code</title><link>https://haykot.dev/blog/pluggable-architecture-in-about-300-lines-of-code/</link><pubDate>Wed, 28 Feb 2024 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/pluggable-architecture-in-about-300-lines-of-code/</guid><description>This blog post guides readers through implementing a pluggable architecture in Go using around
300 lines of code. It introduces the concept, outlines essential requirements, and walks through
the plugin interface and runner.</description></item><item><title>Distributed Locking With PostgreSQL</title><link>https://haykot.dev/blog/distributed-locking-with-postgre-sql/</link><pubDate>Mon, 21 Aug 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/distributed-locking-with-postgre-sql/</guid><description>Learn how to use Postgres native feature to coordinate work across several processes, acting as a mutex.</description></item><item><title>Writing Generic Mappers in Go</title><link>https://haykot.dev/blog/writing-generic-mappers-in-go/</link><pubDate>Fri, 05 May 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/writing-generic-mappers-in-go/</guid><description>In this short post, we&amp;rsquo;ll look at a generic implementation of a mapper functions, and
how to extend it to support some common use cases.</description></item><item><title>TIL Creating Transient Databases For Testing</title><link>https://haykot.dev/blog/til-creating-transient-databases-for-testing/</link><pubDate>Tue, 28 Mar 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-creating-transient-databases-for-testing/</guid><description>This post explores an approach to unit testing database-dependent code by implementing a single backing Postgres instance and a disposable database for each test case.</description></item><item><title>TIL How to Reset Python Environment</title><link>https://haykot.dev/blog/til-how-to-reset-python-env/</link><pubDate>Sun, 05 Mar 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-how-to-reset-python-env/</guid><description>Here&amp;rsquo;s a short script to reset your python environment to a clean state.</description></item><item><title>Self Hosted Developers Guide - Part 1: Infrastructure</title><link>https://haykot.dev/blog/self-hosted-developers-guide-1-infrastructure/</link><pubDate>Sat, 25 Feb 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/self-hosted-developers-guide-1-infrastructure/</guid><description>In this series, I&amp;rsquo;ll be documenting my journey to self hosting my core development tools and infrastructure from
git hosting, CI/CD, backups, container orchestration, and more. This article will cover the infrastructure
I&amp;rsquo;ve set up for my development environment and continues integration.</description></item><item><title>Reduce Boilerplate in Go Http Handlers with Go Generics</title><link>https://haykot.dev/blog/reduce-boilerplate-in-go-http-handlers-with-go-generics/</link><pubDate>Wed, 18 Jan 2023 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/reduce-boilerplate-in-go-http-handlers-with-go-generics/</guid><description>In this article I&amp;rsquo;m going to walk through how I&amp;rsquo;ve been able to reduce boilerplate code and ensure that my handlers have consistent behavior across my application.</description></item><item><title>Go Errors Cheat Sheet 2022</title><link>https://haykot.dev/blog/go-errors-cheat-sheet-2022/</link><pubDate>Thu, 08 Dec 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/go-errors-cheat-sheet-2022/</guid><description>Error handling is a critical part of any software development project. In this post we&amp;rsquo;ll look at some of the common ways that you&amp;rsquo;ll handle errors in Go and a few of the common pitfalls that you&amp;rsquo;ll encounter.</description></item><item><title>TIL Using Custom Marshaling in Go</title><link>https://haykot.dev/blog/til-using-custom-marshaling-in-go/</link><pubDate>Sun, 13 Nov 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-using-custom-marshaling-in-go/</guid><description>A quick look at how to use custom marshaling in Go and why you might want to.</description></item><item><title>5 Useful Hugo Snippets</title><link>https://haykot.dev/blog/5-useful-hugo-snippets/</link><pubDate>Fri, 11 Nov 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/5-useful-hugo-snippets/</guid><description>A collection of useful snippets I discovered while rewriting my blog in Hugo.</description></item><item><title>Introducing Homebox</title><link>https://haykot.dev/blog/introducing-homebox/</link><pubDate>Sun, 09 Oct 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/introducing-homebox/</guid><description>Homebox is a simple, self-hosted, open-source, home inventory platform.</description></item><item><title>Starter Http Client Abstraction In Go</title><link>https://haykot.dev/blog/starter-http-client-abstraction-in-go/</link><pubDate>Sat, 13 Aug 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/starter-http-client-abstraction-in-go/</guid><description>My go-to snippet for starting a simple HTTP client abstraction in Go.</description></item><item><title>What's New in Mealie v1.0.0beta-4</title><link>https://haykot.dev/blog/whats-new-in-mealie-beta-v4/</link><pubDate>Mon, 01 Aug 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/whats-new-in-mealie-beta-v4/</guid><description>The highlights and of the latest release of Mealie including some security updates, and a some new features.</description></item><item><title>TIL: Stopping Requests Mid Flight</title><link>https://haykot.dev/blog/til-stopping-requests-mid-flight/</link><pubDate>Sat, 30 Jul 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-stopping-requests-mid-flight/</guid><description>Today I learned how you stop a request mid flight with the python requests library</description></item><item><title>Docs Aren't Enough, Docker Volume Validation, and Speeding up the Test Suite</title><link>https://haykot.dev/blog/docs-arent-enough-docker-volume-validation-and-speeding-up-the-test-suite/</link><pubDate>Sun, 03 Apr 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/docs-arent-enough-docker-volume-validation-and-speeding-up-the-test-suite/</guid><description>This week I find out the no matter how much time you spend on documentation people probably won&amp;rsquo;t read it. Along with some neat tricks on validating deployments using some docker volume tricks inspired by ACME domain validation.</description></item><item><title>Deep Work, PR Review, and Git Hashes</title><link>https://haykot.dev/blog/deep-work-pr-review-git-hashes/</link><pubDate>Sat, 26 Mar 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/deep-work-pr-review-git-hashes/</guid><description>This week I&amp;rsquo;m starting a new practice to capture my weekly thoughts and notes
and write them up in a weekly blog post. We&amp;rsquo;ll see how it goes!</description></item><item><title>TIL: Testing Parametrized URLs with Chi Router</title><link>https://haykot.dev/blog/til-testing-parametrized-urls-with-chi-router/</link><pubDate>Wed, 02 Feb 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-testing-parametrized-urls-with-chi-router/</guid><description>Today I learned that it&amp;rsquo;s possible to slightly decouple your http handler tests from your chi router. Well sort of&amp;hellip;</description></item><item><title>2022 Dotfiles Highlights</title><link>https://haykot.dev/blog/my-2022-dotfiles-highlights/</link><pubDate>Sat, 22 Jan 2022 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/my-2022-dotfiles-highlights/</guid><description>What&amp;rsquo;s new in my 2022 dotfiles? Mac on utilities, capturing aliases in functions and more!</description></item><item><title>Resources for new Gophers in 2021</title><link>https://haykot.dev/blog/resources-for-new-gophers/</link><pubDate>Wed, 15 Sep 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/resources-for-new-gophers/</guid><description>These resources have made all the difference in going from scratching my head, to actually writing an application that makes sense and that I&amp;rsquo;m excited to keep working on.</description></item><item><title>How to Improve The Jinja2 Experience with FastAPI</title><link>https://haykot.dev/blog/how-to-improve-the-jinja2-experience-with-fastapi/</link><pubDate>Fri, 20 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/how-to-improve-the-jinja2-experience-with-fastapi/</guid><description>While FastAPI is a great first choice for any API development in Python, it&amp;rsquo;s often not considered when your primary goal is to use Jinja2 templates to return HTML to the user. It&amp;rsquo;&amp;rsquo;s hard to match the Ecosystem and support that comes with Flask, but it&amp;rsquo;s easy to get started.</description></item><item><title>Lessons From a Rewrite: Improving Your Git Workflow</title><link>https://haykot.dev/blog/lessons-from-a-rewrite-improving-your-git-workflow/</link><pubDate>Sat, 14 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/lessons-from-a-rewrite-improving-your-git-workflow/</guid><description>The first article in the series on lessons I&amp;rsquo;ve learned from re-writing my
open-source project.</description></item><item><title>FastAPI and Rich Tracebacks in Development</title><link>https://haykot.dev/blog/fastapi-and-rich-tracebacks-in-development/</link><pubDate>Mon, 09 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/fastapi-and-rich-tracebacks-in-development/</guid><description>Let&amp;rsquo;s take a look at how we can integrate Rich&amp;rsquo;s logging and traceback behavior into FastAPI.</description></item><item><title>Auto Initialize SQLAlchemy Models from A Python Dictionary</title><link>https://haykot.dev/blog/auto-initialize-sqlalchemy-models-from-python-dictionary/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/auto-initialize-sqlalchemy-models-from-python-dictionary/</guid><description>As an avid FastAPI and Pydantic user, I&amp;rsquo;ve stumbled into a problem that
is common with any web framework.
How do I turn JSON into a dictionary and then into an entry in my SQL Database?</description></item><item><title>Generating Blog Frontmatter</title><link>https://haykot.dev/blog/generating-blog-frontmatter/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/generating-blog-frontmatter/</guid><description>I recently began the process of migrating my small blog from Ghost to
a static site build with Nuxt. As a part of the process I wanted to create a small
script that would automate some of the basic metadata creation the Nuxt can use
to generate cards and sort content. Luckily, frontmatter in markdown is just yaml,
making it easy to parse and manipulate.</description></item><item><title>Serving SPAs and API With Caddy v2</title><link>https://haykot.dev/blog/serving-spas-and-api-with-caddy-v2/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/serving-spas-and-api-with-caddy-v2/</guid><description>As part of my on going development for Mealie, a self hosted recipe manager, I needed to split the static files from the API to simplify deployment and get some clunky code out of the FastAPI backend. Instead of using the traditional Nginx configuration I decided to use a newer web server Caddy to handle requests.</description></item><item><title>SSH Login Notifications in Home Assistant With Node-Red</title><link>https://haykot.dev/blog/ssh-login-notifications-in-home-assistant-with-node-red/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/ssh-login-notifications-in-home-assistant-with-node-red/</guid><description>This article will go over a basic setup on integrating SSH login
notifications into Home Assistant using Webhooks and Node-Red.</description></item><item><title>TIL Converting Visio to PDFs Recursively</title><link>https://haykot.dev/blog/til-converting-visio-to-pdfs-recursively/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-converting-visio-to-pdfs-recursively/</guid><description>&lt;p&gt;Today I learned that you can use powershell on windows to recursively convert visio files to PDF files. I&amp;rsquo;ve found that when working with design drawings that packaging up a directory of visio files into PDFs is time consuming as most converters don&amp;rsquo;t support Visio formats. Powershell on the other hand can interface directly with the Visio ComObject and do the conversion natively on windows.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$drawings = Get-ChildItem -Recurse -Filter &lt;span style="color:#e6db74"&gt;&amp;#34;*.vsdx&amp;#34;&lt;/span&gt; &lt;span style="color:#75715e"&gt;# Remove Recurse if you don&amp;#39;t want to go into nested directories&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$drawings += Get-ChildItem -Recurse -Filter &lt;span style="color:#e6db74"&gt;&amp;#34;*.vsd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Write-Host &lt;span style="color:#e6db74"&gt;&amp;#34;Converting Visio documents to PDF...&amp;#34;&lt;/span&gt; -ForegroundColor Cyan
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;try&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $visio = New-Object -ComObject Visio.Application
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $visio.Visible = $true &lt;span style="color:#75715e"&gt;# If you want to disable the Visio window you can set this to $false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $i = &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;foreach&lt;/span&gt; ($drawing &lt;span style="color:#66d9ef"&gt;in&lt;/span&gt; $drawings)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $pdfname = [&lt;span style="color:#66d9ef"&gt;IO.Path&lt;/span&gt;]::ChangeExtension($drawing.FullName, &lt;span style="color:#e6db74"&gt;&amp;#39;.pdf&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Write-Host &lt;span style="color:#e6db74"&gt;&amp;#34;Converting:&amp;#34;&lt;/span&gt; $drawing.FullName &lt;span style="color:#e6db74"&gt;&amp;#34;to&amp;#34;&lt;/span&gt; $pdfname
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $document = $visio.Documents.Open($drawing.FullName)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Export all pages to PDF, see constants here http://msdn.microsoft.com/en-us/library/office/ff766893.aspx&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $document.ExportAsFixedFormat(&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;, $pdfname, &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;, &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $document.Saved = $true
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $document.Close()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;catch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Write-Error $_
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;finally&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; ($visio)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $visio.Quit()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>TIL Securing Your Ansible Vault</title><link>https://haykot.dev/blog/til-securing-your-ansible-vault/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/til-securing-your-ansible-vault/</guid><description>When setting up your Ansible playbooks you can include this script in the top directory and run it
from the terminal to add this pre-commit hook. This will check to see if your vault is encrypted
before committing to source control. Make sure you set the correct path for your vault!</description></item><item><title>Wrangling The Vue Components Folder</title><link>https://haykot.dev/blog/wrangling-the-vue-components-folder/</link><pubDate>Thu, 05 Aug 2021 00:00:00 +0000</pubDate><guid>https://haykot.dev/blog/wrangling-the-vue-components-folder/</guid><description>While rewriting the Mealie Frontend in Nuxt and Typescript I&amp;rsquo;ve implemented
a component organization style based on a 3 folder structure</description></item><item><title>Full Body Strength</title><link>https://haykot.dev/workouts/full-body/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://haykot.dev/workouts/full-body/</guid><description/></item><item><title>Lower Strength</title><link>https://haykot.dev/workouts/lower-strength/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://haykot.dev/workouts/lower-strength/</guid><description/></item><item><title>Upper Strength</title><link>https://haykot.dev/workouts/upper-strength/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://haykot.dev/workouts/upper-strength/</guid><description/></item></channel></rss>