RSSAmplifier

Blog

Blog

Latest posts from the blog

blakedietz.meRSS feed ↗101 posts

Latest posts

will.exe

What if there was an AI agent that could act as the executor of your will? The agent could be told to do your bidding long after you've passed. I don't think it would offer much value for the usual uses of divvying up what you have left, but it could open up some fun scenarios. Maybe you want to continue donating to a philanthropic endeavor. Give it access to an investment account, inform it to…

Current mood

Bugs... bugs everywhere

I never thought I would witness the fall of American Democracy

Finished a bullet journal

I’ve been bullet journaling for over a decade. This journal has been with me since 2024. I've taken it with me to Barcelona, Rhode Island and Arizona. It contains both the mundane minutia of day-to-day tasks as well as important learnings that have left their mark on me. It's time to turn the page and slap some stickers on a new journal. Ally recommended I write my future self a letter in the…

Post CrossFit selfie

Ally snapped a candid after 93 burpees.

Wrap your live prod queries in a transaction

Almost every software engineer has been there: you have a query you have to run, live, against production data. Maybe it's a quick hack for a few rows, maybe it's in the thousands. Without going too far into the validity of mucking with production data, I'll preface the below tip with this, you should probably not be working with live data on production. There's almost always a better way to…

No Kings Posters

Allyanna and I went to the third No Kings protest. Here are a few posters we found fun.

15.5 year anniversary walk

Got my first repeat ring muscle ups today!

Today we did some muscle up practice. I was able to get some dirty strict ring muscle ups! I still don’t have bar muscle ups for some reason. And if you don't quite know what a muscle up is:

hMPV sucks

Last week Ally and I believe we caught some hMPV. It’s been close to one full week of having it and I’m just barely making it out of the woods. According to the Idaho Statesman it’s been on the rise in the area . I’m hoping we can get back to the gym and a regular routine this week.

Recycled Minds Improv

Yesterday we went to go see some improv comedy. My mom won some tickets so we decided to go to “The Local” for dinner and get some family time together. The show was decently fun. From an entertainment perspective it was about a 5/10. I would have been alright if the show ended at half time. The first half was actually quite entertaining. The second half seemed to suffer from the group not being…

Going down to Push and Pour with the family

Allyanna got her delicious and A E S T H E T I C strawberry matcha.

Velo

Love my little Kai Ken

Phoenix conditional class shorthand

When working with Phoenix LiveView it's possible to use a shorthand for multiple conditional classes. Take the following component as an example. defmodule AppWeb . Component do use Phoenix . Component def example_component(assigns) do assigns = assign(assigns, red: true , green: false ) # This can be useful when you have a lot of possible configurations for your component. assigns =…

Modifying phx.gen.auth to use ueber-auth

Recently I was wanting to add Google oauth account registration and login to my Phoenix LiveView app. I found a few articles, but there were a handful of errors in the tutorial. I adapted the changes to work with my project and figured I would write about it here to help anyone else looking to set up their app as well. Assumptions This guide assumes the following: You've run mix phx.gen.auth…

Phoenix x Tailwind CSS build not generating classes

sanne Hello folks! I’m having a very strange issue and I’m just baffled… I have a component where I’m setting the background colour with and the colours don’t show up if a number is in the interpolated classname, but fine if the same class is applied directly. (These are Tailwind classes, and the colors are configured) ETA: when inspecting the one that doesn’t work, it does show that the class…

Oahu trip

Allyanna and I were invited to Oahu to attend her friend's wedding from 2023-06-18 to 2023-06-25. As far as planning goes it was on the lower effort side as we ended up going with a Costco travel package, which was a surprisingly good deal in comparison to the competition. I say that it's low effort only in the sense that we didn't plan as much ahead of time. It was my first time and Ally's second…

Adding node.js to your Phoenix Dockerfile for fly.io

For some projects, avoiding the draw of the JS ecosystem just isn't possible. If you ever find yourself needing to add npm modules to your Phoenix app hosted on fly.io, here are the changes required to ensure your build step works. Assumptions Note that this guide assumes you've already run npm init in the assets directory of a Phoenix project. The guide also assumes that you have the associated…

Some calligraphy practice

Calligraphy is one of my forms of meditation. For me the art is mostly a means to avert my eyes from the ubiquitous screens while tapping in to the sensation of scratchy nib on supple paper. Is it good? No. Is it satisfying? Absolutely!

Counting the seconds between the flash and boom

Today finally brought showers to Boise. It was more lighting and thunder than we've seen in as far back as I can remember for this area. Allyanna and I were finishing up the season finale of Barry when we found ourselves pausing the show and turning around to watch the pink and yellow sky as we counted the seconds between each flash and boom. There are few places I'd rather be. Here's a nice audio…

Little man

Yesterday Velo had some sort of episode. He was laying in bed next to Allyanna and was moving his eyes left and right quickly, almost like he had just gotten off a fast spinning merry-go-round. Both of his eyes were dilated. The whole experience lasted about two minutes. We called up West Vet to ask if we should bring him in and they ended up telling us about what they call "the 3x3 rule". That…

What happens when you put multiple Phoenix LiveView hooks on an element?

Even when an idea seems obvious, it can be useful to put a label or name to it. That is, once you explicitly identify something, it becomes easier to reason about or remember if you create a simple fact or label for the idea. Only one Phoenix Hook is supported per element Suppose there exists a Phoenix.Component named some_component . Assume there are two Phoenix hooks named Hook1 and Hook2 .…

Only inputs that are not in focus can be modified from the server side in Phoenix LiveView.

Description When modifying form values in Phoenix LiveView, it is possible to modify the value of all form fields that are not in focus on the client side from the server side. It is not possible to modify values that are in focus on the client side from the server side with LiveView only. The example Suppose you have a form that is backed by a schema for an age range. When the user modifies the…

VSCode tasks for Phoenix projects

Here's the associated git repo . This is here primarily for seo and simplicity. { "version": "2.0.0", "tasks": [ { "label": "Nuke and pave", "type": "shell", "command": "rm -rf ./.elixir-ls; rm -rf ./deps; rm -rf ./_build; mix local.rebar --force; mix local.hex --force; mix deps.clean; mix deps.get; mix deps.compile; mix ecto.reset; iex -S mix phx.server", "options": { "cwd": "${workspaceFolder}"…

Migrating to Phoenix LiveView 0.18

Properties with a leading colon If you're using Alpine as part of your stack, you'll most likely have run into this one. Problem # ... def some_component(assigns) do ~ H """ <div :class="{'hidden': ! show }" > <%!-- redacted --%> </div> """ end # ... Solution # ... def some_component(assigns) do ~ H """ <div x-bind:class="{'hidden': ! show }" > <%!-- redacted --%> </div> """ end # ... Layout as…

Phoenix LiveView: Writing a component that takes arbitrary root elements as an argument

⚠️ Warning Since the release of Phoenix LiveView 0.18.0 this post is no longer relevant. Instead use dynamic_tag/1 . The remainder of this post is left here for the sake of reference. For a while I've been trying to figure out how to write a higher order component in LiveView that allows you to define the root element. While I wouldn't recommend doing this often, there are infrequent scenarios…

Enum.into alternatives and matching structs

Map.new/2 Instead of leveraging Enum.into/2 you can use Map.new/2 with an enumerable collection. Pattern matching structs I learned that you can pattern match structs. def new(%_{} = struct), do : new_from_enum(struct) References Github usage of of pattern matching a struct Reddit thread that introduced me to the ideas Map.new/2

Some birthday gif(t)s

Today's my 31st birthday. My dingus co-workers surprised me with some birthday gifs. I don't want them to disappear into the aether so here they are. 😂 They were also kind enough to get me a giftcard for a nice dinner at Madre. I'm feeling pretty grateful right now. 🥰

Using multiple inputs_for for the same entity

⚠️ Warning Since the release of Phoenix LiveView 0.18.0 this post is no longer relevant. The remainder of this post is left here for the sake of reference. Make sure to pass an id for multiple inputs_for for the same entity You can use multiple inputs_for for the same entity, just make sure to pass ids to ensure that Phoenix can diff the fields correctly. # some-file.ex def render(assigns) do ~ H…

Symbiote

An intro to prompt-fi Recently I've been blown away by the OpenAI model GPT-3. If you haven't heard of it, it's a Generative Pre-trained Transformer 3 (GPT-3; stylized GPT·3) is an autoregressive language model that uses deep learning to produce human-like text.[ source ] It's a fancy way of saying that it's an AI trained on more information than the whole of Wikipedia, which is capable of…

MASH steel all-road mullet build

Photos Allyanna Wintermote took these photos while we were riding on the Hiawatha Trail in northern Idaho. Parts Frame MASH steel all-road Frame MASH Butted steel Fork rake 43 mm Seatpost size 27.2 mm Seat collar size 30.0 mm Headset spec Traditional 1 1/8" headset Rear hub spacing 142 mm x 12 mm Front hub spacing 100 mm x 12 mm Disc mount style Flat mount Cable routing External Wheel size 700 c…

Discovering the extra container element for Phoenix LiveViews

tl;dr live.html.heex has an element that is injected by Phoenix LiveView which causes a difference in DOM structure between live.html.heex and app.html.heex . This difference in structure might impact sharing layouts between app.html.heex and live.html.heex due to slight differences in your application DOM structure. One approach to fixing the problem is through using CSS. You can target the…

Antojitos El Cabezazo!

The other day I was riding from the Idaho Youth ranch after making a donation. I ended up stumbling upon a new food truck. The eatery goes by Antojitos El Cabezazo! It's located at 340 N Orchard St Boise, Idaho 83706. We ended up grabbing a handful of tacos. My favorite was the chorizo by far. If you're near the Central Bench, go give the place a shot. The owners are kind, and the food is…

Some tailwind libraries I&#39;ve been dabbling with

Tailwind UI - Official Tailwind CSS Components daisyUI a€” Tailwind CSS Components Flowbite - Build websites even faster with components on top of Tailwind CSS

Solved: ERR_MODULE_NOT_FOUND

Environment Operating system macOS 11.6.1 node.js runtime 16.13.1 package.json { "name": "repro", "version": "0.0.0", "description": "repro", "type": "module", "engines": { "node": ">= 16.13 <17" }, "devDependencies": { "@tsconfig/node16": "^1.0.2", "@types/jest": "~27.4", "@types/node": "~16.11", "@typescript-eslint/eslint-plugin": "~5.14", "@typescript-eslint/parser": "~5.14", "eslint": "~8.11",…

Sending and receiving SMS messages with Phoenix and ex_twilio

Background While working through some of the ex_twilio documentation , I couldn't find any specific examples of how to respond to incoming text messages. I was surprised to see such a basic example missing from the documentation. After a little digging I was able to create a simple solution. This article will walk through how to send and respond to SMS messages from twilio via Phoenix and…

Weekly update: 2022 Week 12

What I'm grateful for My partner Allyanna Allyanna and I celebrated our 11.5 year anniversary with a date at the first restaurant we went to together: Papa Joe's. Before that we went to Hyde Park Wine and grabbed our monthly allotment while enjoying some of our complimentary tastings and the gorgeous weather. All of that was topped off with the simplicity of riding our bikes to each location. What…

Weekly update: 2022 week 11

What I'm grateful for Remote work This week I travelled to Pocatello with my partner Allyanna and it was all possible because I'm able to work remote. What I'm thinking about Stoicism What I'm working on https://www.b4b.guide I'm working on a fun little side project for personal use. The project is essentially a shared deck editor for the video game "Back 4 Blood". It's written in the PETAL stack.…

Good reads for software engineering

Learning and mindset expert-beginner try Architecture 12factor Patterns and antipatterns boolean-traps Project management big sliding References The biggest mistake I see engineers make 12 factor app You must try and then you must ask Boolean traps How developers stop learning: rise of the expert beginner The sliding scale of giving a fuck

Weekly update: 2022 week 5

What I'm thinking about Suboptimal defaults I've been thinking about default configurations that don't make sense. Things like desk layout, editor orientation and gaming keyboard mappings are not the best solutions to the problems they solve, but they still won as the recommended solution. What I'm working on Better communicating work with my partner Allyanna Allyanna and I have been trying to…

Weekly update: 2022 week 4

What I'm thinking about Family Jessica My older sister Jessica spent her time in Idaho from 2022/01/20 until 2022/01/30 visiting. She stayed with Allyanna and I for the most part with some visits to Fruitland as well as to her new granddaughter's house. It was a nice opportunity to catch up with my middle sister. There have been so many miles and so many years between us; to say I missed her…

Using Phoenix&#39;s `schema.web_path` to account for web namespaces in your templates

For a personal project I have some generators for live views. They handle most of the boilerplate of starting a live view based feature and create components, as well as their concomitant test files. These are a custom set of generators that work similarly to phx.gen.live but have more application specific styling and functionality. The application referenced above is using Phoenix web namespaces…

Weekly update: 2022 week 2

What I'm thinking about How avoidance impacts my life I had a recent conversation with my sister Jessica and she mentioned some psychology concepts that made me start doing some reflection. I came to realize that there are certain aspects of my life that I'm avoidant about. This is something I'm going to dig a bit more into to learn more about myself. Mimesis I've been thinking a lot about the…

Elixir live view cheat sheet

Lifecycle methods mount or handle_params The golden rule is: always load data on mount. But if you add live navigation with live_patch , the data that can be changed on-the-fly must be now loaded on handle_params . 1 PubSub MyApp.Endpoint.subscribe or Phoenix.PubSub.subscribe ? Of the whole “pubsub” based api on the endpoint (8 funs) two happen to be mostly delegations. That’s what I consider…

Valheim selfie

Allyanna, Zac and I finished Valheim together on 2021-05-09 at 00:04:06. It was one of the first more challenging games Ally had finished and was a great time with Zac. :)

2011 Cinelli x Mash Histogram: Freak Alley photoshoot

Confusing day

Poem number two

There was a challenge in the book "Toilet Tag'. It's a cute product that you place on the toilet. Each page is filled with a question or challenge that is to be answered while on the toilet. That player fills it out and waits for responses to the same challenge from other players who fill it out while sitting on the toilet. One of the prompts was to write a poem about poop, so here ya go 🤷‍♀️ The…

Setting up an elixir app to run under systemd

Define a service file Defining the following ensures that even after system restart your service is restarted # /lib/systemd/system/torrent_top_10.service [Unit] Description=Run top 10 torrent service # Wait until the network is available After=network.target [Service] # Run the binary that was generated by mix release…

Elegant UI: Amazing Marvin&#39;s add to list items

I've been tickled by how delightful Amazing Marvin's user experience is. The developers of Amazing Marvin consistently go above and beyond when implementing features. They carefully tailor the experience for the user, sometimes eschewing common design patterns and adding their own flare for even the smallest interactions. If you're looking for a task management system I highly recommend giving…