RSSAmplifier

Blog

Retrovertigo: Blog by Dorian Karter

Thoughts & TILs about Elixir, Elm, React, JavaScript and other things.

doriankarter.comRSS feed ↗68 posts

Latest posts

Country codes to flag emoji in Elixir

I just read this blog post. It showed, in JavaScript, how to convert country code string to its respective flag emoji, and I wanted to see…

My dotfiles were featured on Substack

Hey! just wanted to share that my dotfiles were featured on the Dotfiles publication on Substack by Adib Hanna https://dotfiles.substack.com…

Visualizing Elixir OTP Supervisor Strategies

Introduction Seeking a hands-on way to further explore Mermaid — a remarkable JavaScript diagramming and charting tool — I decided to apply…

Unraveling Homebrew Dependencies: A Handy Guide

Have you ever installed something using Homebrew and noticed the command's output updating seemingly unrelated packages? This recently…

Avoiding Data Loss: Understanding the `:on_delete` Option in Elixir Migrations

When working with Elixir and Ecto, it is crucial to fully understand the option for (aka foreign keys) in migrations. This option dictates…

Inspect contents of Lua table in Neovim

When using Lua inside of Neovim you may need to view the contents of Lua tables, which are a first class data structure in Lua world. Tables…

GenServer handle_continue/2

I recently learned about a delightful new(ish) feature in Elixir's GenServer that managed to slip under my radar. This feature is the…

Never use `git branch` in a script without doing this!

I like automating commands that I run often, and one of my favorite command line tools to use when automating scripts involving selection is…

How does DNS work?

(Maybe Obvious) Preamble What is DNS? Wife: What's DNS? Me: It's that thing you use every day when you browse the web on your phone. Me…

Borrowing in Rust

In Rust when you pass a variable to a function it is technically "moved". That means the the caller looses ownership of the variable and can…

Remove duplicate lines in Vim

To remove duplicate lines in Vim you can pipe a selection from the current buffer into : Select all lines you want to dedup (linewise) and…

Fix internet connection after reboot with ProtonVPN

If you're using ProtonVPN with the Kill Switch feature on a Debian based operating system (such as Ubuntu/Pop_OS!), you may find yourself…

Canonical Link Tag w/ Gatsby

I recently scraped all my old Hashrocket TIL posts and re-posted them here on my blog. One of the reasons is that I wanted to have all that…

Customize Vim's gx mapping

One of my favorite Vim mappings is gx. When hovering over a URL with the cursor in normal mode and using this mapping, Vim will open the URL…

Create Github PRs from a Jira Ticket

TL; DR: add this function to your / to create a PR from a Jira ticket: If you use Jira at work, but prefer to live in the terminal whenever…

Peter Bernstein: Eronel Guitar Solo

My guitar teacher introduced me to this performance by Group 15 (Tom Aalfs, Peter Bernstein and Jay Leonhart) of the song Eronel by…

Retrovertigo

What's with the name? Retrovertigo is a song by one of my favorite, and most eccentric bands out there, Mr. Bungle. This song was released…

New Blog!

Why a new blog? The shoemaker's children go barefoot My previous blog was built using Jekyll in 2014 and hosted on Github Pages. This blog…

Print stacktrace in Elixir #ElixirLang

When you are trying to debug something it is usually helpful to see the stacktrace of what called a function. If you're inside of a…

What's my public IP? #automation #linux #terminal

Ever wonder what your public IP looks like? When I do, I usually search duckduckgo.com for "what's my ip" and it is nice enough to tell me…

No ifconfig on Linux?

If you are on a Linux machine and trying to run you may get . That is because some Linux distros don't come with it bundled by default. On…

What does that git alias do? 🕵️‍♂️

I have some git aliases in my dotfiles and sometimes I use an alias for too long that I actually forget what it does under the hood. I can…

Use pgrep and xargs to kill (processes) #zsh #bash

Have you ever found yourself doing this: And then copying the pids one by one so you can pass them to ? There's a better way to return just…

Add visual fold markers to Vim's gutter

TIL that you can display visual fold markers in Vim's gutter by setting the ! The number indicates how wide the gutter holding the fold…

Debugging: Elm evaluates uncalled `let` variables

If you write a function that has a expression variables like so: When the function is called you will see the console log message that…

Pretty-Print JSON in NeoVim/Vim using jq

I've written here before about how to pretty-print JSON in Vim but since then I have found an even easier method using . jq is an amazing…

Get a writable temporary directory in Elixir

When you need to write a temporary file to disk it is common to assume a particular path exists based on the operating system the app is…

🔒 Serve Phoenix App Locally with HTTPS 🔒

The Phoenix Framework provides an easy mix task to automatically generate a self-signed SSL cert. This is useful if you want to test the app…

Optimize Images for the Web the Easy Way

TIL I learned about a really useful, open source, image optimization app called ImageOptim. This app will help you batch resize image files…

Clean stopped containers & dangling images #docker

Today I learned how to clean stopped containers in Docker. Starting in Docker 1.13 a new command has been introduced. (docs) No one likes…

Delete lines from file with sed

Imagine the following file: sed.test If you want to delete a line matching a regular expression (e.g. ), you can use at the end of your…

Get `ping` linux command on docker

The ping utility is super useful for debugging network issues on docker, but it's package name is not as intuitive as . To get it on your…

Get the linux `ip` command line utility on docker

Linux has a network utility called which can be very useful when debugging networking issues inside a docker machine. If you type inside…

The paste event in browsers

Browsers allow you to capture a event in a DOM element [1] [2]. This event fires before any clipboard data is inserted into the document…

Install node modules in subdir without a CD

So yea you don't need a friend to send you a CD-ROM anymore to install node modules. You can use the World Wide Web! Pretty exciting. On a…

Delete remote git branch - the declarative way

Cleaning up after yourself is important, and not just in real life. Good Git Hygiene™ goes a long way. One of the methods I like to clean up…

Easily delete a long word in terminal

When you type that long feature branch name or URL but then want to delete it you have a few options, but hopefully you don't hold your…

Reverse sort lines in Vim

Vim provides command for ordering lines in an ascending order, but what if you want to sort the lines in a reverse order? Linux's to the…

Pipe all output from a command (stderr & stdout)

When you write a bash/zsh script relying on pipes normally you will not be able to pipe through text from the stderr output with a normal…

Use another SSH key/command for Git

If you need to use a different SSH key for a git command such as you can do so by setting the environment variable like so: This can…

Get ONLY PIDs for processes listening on a port

The lsof utility on Linux is useful among other things for checking which process is listening on a specific port. If you need to kill all…

Copy files with progress in terminal w/rsync

When you need to transfer a lot of files from one location to another it's sometimes useful to have some progress indication and maybe even…

Get last nth elements from Enumerable in #Elixir

You probably know about where is a number dictating how many elements you want to take from an Enumerable. Use it like this: But how can…

Enable 4k UHD video streaming in Firefox

By default, Firefox does not support the VP9 WebM codec sites like YouTube use to deliver 4k quality video. If you visit a video that…

Show escaped bash color codes in less #linux

My ls command colors directories and files according to their type and permissions: ls with color But when the window is too small to fit…

Vim: Peek horizontally without moving the cursor

Some people like wordwrapping in Vim. Personally I find it annoying for code because it can destroy the meaning of the code in the context…

Show materialized view definition in #postgresql

PSQL offers a handy function for showing the definition of a view. That function does not seem to work on materialized views. To see the…

Hide all other windows on #macOS

Sometimes your desktop gets cluttered with windows of different running applications which makes it difficult to concetrate on the task at…

Using `yarn global` w/ Node through asdf (mac)

The asdf version manager is an awesome tool for managing many different language runtime versions. I recently started using it for Node and…

Custom errors in JavaScript ⚠️

Javascript provides the ability to create custom errors by modifying the prototype of a function to the Error protorype. This is how one…