Chris Padilla/Blog
My passion project! Posts spanning music, art, software, books, and more. Equal parts journal, sketchbook, mixtape, dev diary, and commonplace book.
- Converting your data to JSON
- Passing the ID as a query param
- Comparing between the string representation of the ID and the
ObjectID
data type - Skylark – Piano
- Boogie Woogie – Piano
- All the Things You Are – Chord Melody
- My Mix CD Intro
- To Zanarkand (not a jazz standard, but certainly a Final Fantasy standard!)
- Setting Up OAuth and Email Providers for Next Authentication
- Deploying Docker Compose Application to AWS EC2
- Configuring a CI/CD Pipeline in CircleCI to Deploy a Docker Image to AWS ECS
- Layers in a Java Spring Boot API
- Getting Started with LangGraph
- What Matters Most by James Hollis — Read this at least 5 times this year. Highly resonate. Would absolutely recommend to anyone that's reached the end of their success script in life.
- Rodney R. Rodney by Violaine Briat – A slice of life/comedy horror comic. A very particular flavor, and I'm all about it.
- Harmonic Experience by W. A. Mathieu – I spent a few evenings with this music text book. Absolutely beautiful. The most human approach to teaching theory. I wish I could go back and swap my theory classes with exercises from this book.
- The Sketchbook of Loish: Art in Progress — Stunning character art! I'm only just becoming familiar with her work and I haven't been able to get enough of it.
- FORCE: Dynamic Life Drawing by Mike Mattesi – My favorite figure drawing resource so far. A genuine focus is put on gesture and expression from the beginning. Works best when paired with the online video courses.
- Dynamo
- How Long Is a Piece of String?
- 5 Years of Programming and Leading With Curiosity
- Staying In the Ring
- James Gurney and Art as an Expression of Nature
- Solar eclipse!! 🌑
- A few great trips: Chicago for work, Austin for a friend's wedding, and Pennsylvania for Miranda's sister's wedding.
- Miranda and I saw Maggie Rogers in concert for our shared birthday. She was even better the second time!
- Also saw Lucinda Williams in concert. Still going strong!
- Playing in a community band! 🎷
- Got really into vintage PC's and ended up at VCF SW in Dallas. 💾
- Spending one day a week working from Denton before said community band rehearsals.
- Hosted a close friend from grad school several days in the fall.
- Moved to a more suburban part of Dallas. Loving it!
- A+ Christmas in Houston with Miranda and my folks. 🎄
Repetition and Meditation
A big reason I still play instruments is for how genuinely soothing it is.
When learning a technique or a piece, it's unavoidable: There are some things you'll just have to play at least several hundred times. Beginners tend to groan at that, and can get discouraged. When you commit to learning an instrument, you're signing up for a lifetime of repetition.
But I've come to like it. Repetition becomes something like prayer. Something gentle to keep your mind centered around something while the subconscious takes care of cleanup duty.
Or, for the secular, it's akin to the benefits of walking throughout the day. If you're not musically inclined, walking gets you pretty similar benefits. Just one foot in front of the other again and again. Connecting with something beautiful — in this case, nature.
For me, though, I like having a little tune learned by the time I make it home.
Deeply Partial Zod Schemas
It's not uncommon to set up a schema with nested properties. In Zod, it could look something like this:
export const userSchema = z.object({
_id: z.string(),
profile: UserProfileSchema,
email: z.array(UserEmailSchema),
calculated: CalculatedUserSchema.optional(),
system: SystemUserSchema.optional()
});
const userProfileSchema = z.object({
firstName: z.string().min(2).trim(),
lastName: z.string().min(2).trim(),
image: z.string().optional()
});
// etc...
This is great for verifying a type has all the required properties. It gets tricky when I want to set all the values as optional, as I might in a $set
object for MongoDB.
Previous versions of Zod had a method deepPartial
that handled just that. It's since been deprecated, but no library replacement has been provided.
In the meantime, you can pull in the original logic into your project to implement the previous logic. It's handily available on this GitHub thread.
Writing For
From Jeremy Keith's What the world needs:
If we’re going to be hardnosed about this, then the world doesn’t need any more books. The world doesn’t need any more music. The world doesn’t need art. Heck, the world doesn’t need us at all.
So don’t publish for the world.
When I write something here on my website, I’m not thinking about the world reading it. That would be paralyzing...
I’m writing for myself. I write to figure out what I think. I also publish mostly for myself—a public archive for future me. But if what I publish just happens to connect with one other person, I’m glad.
Just came across this from earlier in March and forgot that I 1.) already read it and 2.) got great inspiration from it. It's an especially hard problem when worrying about being original on the entire internet. But, as Jeremy points out earlier in the post, you don't have to be original.
Smoother MongoDB ObjectID Handling in Web Applications
Documents in MongoDB automatically generate a unique key on the _id
field. The value is an ObjectId
, a byte data type that is very lightweight. (More details in the docs.)
When querying your DB, you'll be returned an ObjectID
data type. There are several scenarios in a web application where that can become cumbersome:
To navigate around it, you can project the value to a string any time you query the db.
Here's an initial example of querying a collection in an API method:
export async function getPeople(query = {}): Promise<Person[]> {
const client = await clientPromise;
const collection = client.db('your-db').collection('people');
const people = await collection
.find<People>(query)
.toArray();
return people;
}
To convert the _id
value, we'll create an aggregation step to make the conversion with the $toString
operator
const addFieldAggregation = {
$addFields: {
_id: { $toString: '$_id' },
}
};
Now, when querying from your application, you can convert the string value back to an ObjectId
to query the intended document. I'll just convert our query to an aggregation to accomplish this:
import { ObjectId } from 'mongodb';
export async function getPeople(query = {}): Promise<Person[]> {
const client = await clientPromise;
const collection = client.db('your-db').collection('people');
const person = (await collection
.aggregate([
{
$match: query,
},
addFieldAggregation
])
.toArray()) as Person[];
return person;
}
Voilà!
Pace Layers
I've just been introduced to the idea of Pace Layering via Chris Coyier:
...If you feel frustration at how quickly or slowly a particular technology moves, are you considering its place within the layers? Perhaps that speed is because it is part of a system that pressures it to be that way or it being that way is beneficial to the system as a whole.
Amazing to think how transferable it is to other domains. And to have acceptance of the fact that some things are meant to move quickly, others more slowly. The case for government vs commerce in Steward Brand's original case for this feels perpetually timely.
This compliments well with a bit of advice from Derek Sivers to focus on what doesn't change:
Instead, forget predicting, and focus on what doesn’t change. Just like we know there will be gravity, and water will be wet, we know some things stay the same.
People always love a memorable melody. You can’t know what instrumentation or production style will be in fashion. So focus on the craft of making great melodies...
Instead of predicting the future, focus your time and energy on the fundamentals. The unpredictable changes around them are just the details.
Moonlight In Vermont
Telegraph cables, they sing down the highway,
And travel each bend in the road~
No recording more magical than Louis and Ella.
Mountain Bird
Stewart Copeland Composing for Spryo
Well this is delightful!
"I look for how to make those inner complexities more complex, and have deeper sublayers and things that don't really get you the first time, but the 16th time so it can stand repeated listening."
So much to love here. "They pay me for this!"
Handling Dot Notation in MongoDB
There's quite a dance that needs to happen when sending data to a document in MongoDB.
Say that your document takes this shape:
import { z } from 'zod';
const userSchema = z.object({
_id: z.string(),
profile: UserProfileSchema,
email: z.array(UserEmailSchema),
calculated: CalculatedUserSchema.optional(),
system: SystemUserSchema.optional()
});
const userProfileSchema = z.object({
firstName: z.string().min(2).trim(),
lastName: z.string().min(2).trim(),
image: z.string().optional()
});
const userEmailSchema = z.object({
address: z.string().email(),
verified: z.boolean().default(false)
});
// etc...
Note that there is an email
field with an array of objects.
If I wanted to update the address of the first email object in that array, my path object would look like this:
const patch = {
'email.0.address': "hey@chris.com",
}
Here's what you get back from dirtyFields
when you're using a form library on the client such as react-hook-form:
{
email: [
{
address: address,
}
]
}
That would essential replace the entire email field in the db.
There are a few steps to take to handle this:
First, let's pull in a library to handle converting the object to dot notation:
import { dot } from 'dot-object';
const dirtyFieldsDotNotation = dot(dirtyFields);
// {
// "email[0].address": true
// }
Then, we can pass in the actual form value to the results object:
const updatedValues = dirtyFieldsKeys.reduce(
(acc: Record<string, any>, key: string) => {
const regex = new RegExp(/\[|(\]\.)/, 'g');
const parsedKey = key.replaceAll(regex, '.');
acc[parsedKey] = get(parsedUpdatedValues, key);
return acc;
},
{}
);
// {
// "email.0.address": hi@chris.net
// }
Here, I've added a step to replace all angle brackets []
with a period .
to conform with the expected array access syntax for mongo.
With that, our object is now safe to send to our api and pass to our patch call to Mongo:
const client = await clientPromise;
const collection = client.db('project').collection('users');
const result = await collection.updateOne(
{ _id: id },
{ $set: patch },
{ upsert: true }
);
Lady Be Good
All dressed up with no place to go.
Trying out some Gershwin chord melody! A bit of a slower take on the original.
Lemonaid
Curation as Creation
Back at music school, a close friend and I were talking about creativity in our practice. We were studying classical music performance, where you don't write music, you play other people's music.
My friend was making the point that performers were not creative in the way that a composer was creative. (It's not an unreasonable opinion. I swear I read in one of Seth Godin's books a similar observation.)
But I didn't believe that was really fair.
Performers have a choice in how they spend their time: What styles they play, which composers they chose to perform, and how to bring life to what is really just dots on the page.
Several performers I know actually make a clear identity around their repertoire, be it pop covers, women composers, or Russian violin sonatas transcribed for saxophone.
Point being that, no, classical performers aren't in the weeds of deciding which notes to play. But that doesn't mean they aren't being creative.
I've made a move to write, compose, draw, develop software, and do all sorts of things that are considered more creative. But after a few years of this, I'll admit that it didn't take getting more granular in the decision making process to be creative. Curation itself has been a creative process.
This, in my mind, is another reason why being original shouldn't be a requirement that holds you back from doing whatever gets you excited to create. Even if your work is collaging.
2024
Well, the year's start comin', and they don't stop comin'. Neither do the year-in-review blog posts!
Chop Wood, Carry Water
I've entered a chop wood, carry water phase in several areas of my life. And I'm pretty satisfied with that!
I remember when I started learning to play saxophone as a kid. The first year or so were such a blast. There was something new to learn every day. The feeling of a new identity emerging was exciting. And each problem to tackle was wholly novel.
The further along I went, though, it became less about solving novel problems, and doing the common things uncommonly well.
This is where plenty of people will fall off of a project, or leave a skill after becoming an advanced beginner.
But I'll say that I've missed this feeling of routine. While it's not as flashy, there's something comforting about continuing to refine a skill or a project just a bit at a time through repeated effort.
I've tried new things and stretched, sure. Though, in a large part, they're continuations of things I've been doing for a few years now. And I'm happy to be settling in. The road stretches far ahead, and I'm looking forward to walking it. One foot in front of the other.
Art
In 2023 I taught myself to draw. In 2024, I focused on taking those skills to digital art. I've loved working with color and light.
I wrote down my impressions from the experience earlier this year.
I'm far from comfortable with it. When I'm a bit low on energy, I'll reach for a sketchbook, preferring figure studies and drawing from imagination. But digital painting has yielded my proudest pieces. And my album artwork has gotten much more interesting thanks to it!
More to continue into the next year!
Music
I thought I'd try to take things slow this year for writing music. But my curiosity got the better of me!
This year I released 9 short albums. I wanted to lean into recording more of my guitar playing. The Takanaka inspired Snow Cones, the moody midwest emo vibes of Dog Angst, the folksy Flowers album, the light acoustic Desert, and my recent swing at a punk single My Mix CD all satisfied that itch.
Compared to purely produced albums, these have been humbling. When producing, there's really only 2 phases: Compose & Refine. But with acoustic instruments, there's a third phase: Practice the Dang Part Until It Sounds Good. So they take a while! But it feels great to be bringing my own two hands into the music I'm writing!
My production albums were fun explorations. Several tech nostolgia works: Drum and Bass with Space Frog 64, 80's fusion & atmospheric music with Jam 3D, Square's SNES era JRPG's with Super Duck RPG, and the Frutiger Aero aesthetic with SkyBox.
It's been a lovely year on piano and guitar, too. I've spent much of the year with jazz standards on piano, and just started doing the same on guitar partway through the year. Here are my favorite recordings:
Tech
It was a very DevOps year for me. I spent plenty of time during the year getting familiar with CI/CD processes as well as deploying Docker Images to AWS.
I aim to learn a new programming language each year to stay sharp. This year it was Java. Many similarities to C#, of course. And I'm appreciative of that — I felt there was more time to really get comfortable with the OOP aspects of those languages since there was so much that was already familiar.
While not a new technical skill, I'll say that I've been enjoying greater ownership in my work. It's highly gratifying to be taking on larger projects and responsibilities. And, of course, with that there's more to learn all the time. A happy position to be in!
Here are a few favorite posts covered on the tech blog this year:
Favorite Books Read
I didn't read too many new books. If anything, I enjoyed revisiting books from previous years. So here's a short list:
It may be time to revive a couple of good habits: Having an audiobook handy and leaving a new-to-me book by my bed.
Writing
I also eased up on writing this year. I wanted to pour more time into the crafts above. I noticed partway through the year that it was hard to find time to write fuller articles, so I started the Clippings tag. Still a collection in progress. It's something that I'm hoping to keep short and sweet. That way I won't feel shy about jotting something down!
My favorites from this year:
Life
In list format, other things that were great this year:
2025
I'm going to be targeting a longer term project for the next year. Not much to say just yet, more to come later.
For everything else: Chop wood, carry water.
See you there! 🪵🪣
Knowledge Pyramid
Neal Ford and Mark Richards present a useful way of thinking about knowledge as a technologist through the knowledge pyramid.
Mark’s pyramid illustrates how fundamentally different the role of architect compares to developer. Developers spend their whole career honing expertise, and transitioning to the architect role means a shift in that perspective, which many architects find difficult.
Here, this is applied to software architect as a role. I'd say it's also helpful for anyone in a product decision making role to consider.
The focus early on in a career is in specialization. As responsibilities expand, it becomes more important to gradually fatten the T.
Dynamo
A friend recently asked me how I keep up with so many practices. Specifically how I find the energy to do it.
The secret is that the energy comes from doing it all.
Walt Stanchfield explains it well in an essay advocating for keeping a sketchbook:
Carry a sketch book — a cheap one so you won't worry about wasting the page. Sketch in the underground, while watching television, in pubs, at horse shows. Sports events are especially fun to sketch — boxing matches, football games, etc. Draw constantly. Interest in life will grow. Ability to solve drawing problems will be sharpened. Creative juices will surge. Healing fluids will flow throughout your body. An eagerness for life and experience and growth will crowd out all feelings of ennui and disinterest.
Where are you going to get all this energy, you ask? Realize that the human body is like a dynamo, it is an energy producing machine. The more you use up its energy, the more it produces. A work-related pastime like sketching is a positive activity. Inactivity, especially in your chosen field, is a negative. Negativity is heavy, cumbersome, debilitating, unproductive, and totally to be avoided. Take a positive step today. Buy a sketch book and a pen (more permanent than pencil), make a little rectangle on the page and fill it with a simple composition.