RSSAmplifier

Blog

camdez

Recent content on camdez

camdez.comRSS feed ↗134 posts

Latest posts

Fixed Order Sorting in Clojure

Here’s another tidy bit of Clojure that makes me happy… Of course it’s easy to sort items in the natural order: (sort [ 1 3 4 2 ]) ; => (1 2 3 4) Or via a mapping to elements that sort in a natural order: (sort-by count [ 'xx' 'xxx' 'x' ]) ; => ('x' 'xx' 'xxx') But how do we sort in a user-defined, fixed order?

The Duality of Transducers

I finally got around to re-recording and posting this talk on Clojure’s transducers that I gave last year to the Austin Clojure Meetup :

Clojure Submaps

The gentleman behind Clojure Diary was kind enough to recently post a video based on a small comment I made on his YouTube channel: Clojure Diary - Elegant way of filtering maps based on key value pairs . (Please check out his channel as he’s doing a great job regularly posting videos about his journey through Clojure!) In my comment I used a little submap? function from my personal…

Chinese Zodiac Time for Emacs

In the spirit of Chinese New Year, I hacked up a small extension for Emacs to render the current time of day using emoji and Chinese characters: Various configurations for your mode line.

Java Allergies and Revisiting java.time

Wherein I argue that Clojurians should be a touch more embracing of Java interop and that java.time is actually good.

Fix clj-refactor Libspec Stealing

(This post is regarding a very particular issue at the intersection of Emacs, Clojure, and CIDER , so most readers can probably skip it, but I figured the solution deserved to be somewhere on the internet.) CIDER has this awesome feature via clj-refactor where it can automatically add missing libspecs to your ns form as soon as you type an aliased var name using an :as alias you have previously…

Clojure Thread Dump

From the department of How Did I Never Learn This in 12+ Years of Clojure? comes today’s tip: Did you know you can generate a thread dump (+ memory usage information) from a Clojure REPL with a single keystroke? I sure didn’t.

Notes on Upgrading Datomic On-Prem to v1.0.6726

After the news from the Clojure/conj that Datomic is now free, I was excited to get home and upgrade and access newer features and high-availability. Herein are notes from how that upgrade process went that I hope will be helpful to anyone else upgrading, including difficulties I had running the official Datomic AMIs.

2023 SXSW Taiwan Beats Playlist

The Taiwan Beats Showcase is probably my favorite music event at SXSW , and I make a point to catch it every year. This year I put together a playlist of songs by all of the performing artists for my friends at the Austin chapter of Taiwanese American Professionals . Photo of Elephant Gym performing at SXSW 2019

git: Quick Multi-Line Commit Messages

I don’t know why I’m quite so tickled by this, but today I learned that you can make multi-line git commit messages by passing multiple -m arguments:

Feature & Formatting Test

This page is an internal test demonstrating various features of this blog to ensure that they are working and styled correctly. You likely won’t find it very interesting. Table of Contents Typography Inline Styles Block Styles Lists Rules Headings And They Look Like Typography Dashes: - – — Ellipses: … Inline Styles Text can be italic.1 Text can be bold. Text can be struck…

Emacs: Running Shell Commands on the Current File

I’ve long thought it was a little funny that Emacs doesn’t provide an easy way to run a shell command on the current file. It turns out it does, but it’s not as obvious as you might expect.

How to Create a Customized Clojure Docker Image

Creating a Docker image isn’t particularly difficult, but I never do it often enough to remember the incantations required. Yesterday I needed a Docker image for running CI jobs on Circle CI . There are some great pre-built images out there, but I couldn’t find the combination of Java 17, Leiningen, and Node that I was looking for. This is a quick guide to how to build your own image…

Regex Optimization in Clojure

Earlier this week, after responding to a post on ClojureVerse , I got curious about re-implementing the basics of Emacs’s regexp-opt function in Clojure. I thought it would be a fun little coding exercise so I decided to take a stab at it during a few spare minutes in my day and was very pleased with the concision and clarity of the result.

Clojure Indentation Commas

Lately I’ve been dabbling in using commas to control indentation in Clojure. I’m sure this will be a contentious one, but I wanted to put it out there to spur converation.

Interactively Evaluating Clojure Code in Comments in Emacs

There’s a loose convention in Clojure of leaving top-level (comment ...) -style comments in source files to give examples of how a particular piece of code works or to provide a convenient means of invoking functionality contained in the file. You can even see this in the source files to Clojure proper . Even though leaving commented out code can seem a bit messy, it has also saved me a ton…

Launching Dev Dependencies with tmux

When working on CollBox , we have a handful of external services the app depends on which we need to have running at development time. I used to run these via Foreman , but somewhere along the way my Ruby installation seems to have gotten borked (thanks, Catalina ?) and since then I’ve been running the services by hand. I always work in a tmux session anyway, so I decided it was time to see…

2017 Reading List

Last year I tried out making a reading list in January, to keep myself reading at an acceptable pace, and to put a bit more foresight into what I would be reading. This worked out pretty well. Despite finishing a couple of my 2016 books in the first days of 2017, I largely stuck to my schedule, and I finished everything on my list, including a few rather lengthy items. I actually didn’t read…

Curation is Creation

Last Black Friday I posted to Facebook: I’m abstaining from buying anything today in protest of excessive consumerism. Make something instead! And got a rather curious reply from a friend: I wish I could make things I mulled that over for quite a while. I struggled to put myself in the commenter’s shoes. It’s wildly foreign to me. In my head, clearly creation is for everyone.…

In Which I Realize that Naming is Even Harder

I was just lying in bed reading when I had a small realization related to my last post, No, Seriously, It’s Naming 1 : my names are wrong–but maybe not how you’d expect. If you recall, I left things like this:

No, Seriously, It's Naming

I just read David Bryant Copeland’s post It’s not Naming That’s Hard—It’s Types which he wrote in response to Katrina Owen’s What’s in a Name? Anti-Patterns to a Hard Problem and I feel compelled to say a few words. Katrina’s post provides some suggestions around the perennial developer challenge of naming things in code. Along the way she asserts that including…

Projects

This page is a work in progress. These are a few of the software projects I’ve released over the years. There’s a lot more + most of my programming effort over the years has gone to collaborative projects not listed here, but this gives a taste of my work. sendgrid (Clojure): A simple library for sending emails with SendGrid. honeybadger / ring-honeybadger (Clojure): A highly-flexible,…

Project: SendGrid for Clojure

TLDR: If you need to send emails via SendGrid from a Clojure application, check out the sendgrid library I just released, it’s pretty swell.

Reading Notes: Just Fucking Ship

Whenever you look around, you know what you should be doing: creating and launching and selling a product, bootstrapping a business on the side. You’re smart. You’re capable. You’ve got the skills to make stuff […] why can’t you just make this happen? […] We’ll teach you 21 principles for getting off your butt and finally shipping. ( official site ) Part of my 2016 reading list .…

Reading

2017 2017 reading list. February The Art of Learning, Waitzkin The Country of the Blind: Mandarin Companion Graded Readers Great Expectations: Part 1: Mandarin Companion Graded Readers Traction, Weinberg & Mares January The 12 Bottle Bar, Solmonson Influence, Cialdini The Importance of Living, Yutang 2016 2016 reading list. December Thinking, Fast and Slow, Kahneman The Pillars of the Earth,…

Reading Notes: The Meditations of Marcus Aurelius

Meditations …is a series of personal writings by Marcus Aurelius, Roman Emperor from 161 to 180 AD, recording his private notes to himself and ideas on Stoic philosophy. Marcus Aurelius wrote the 12 books of the Meditations…as a source for his own guidance and self-improvement. ( Wikipedia ) Part of my 2016 reading list . Definitely a worthwhile read. I read the (recent) Hays…

2016 Reading List

2015 was a haphazard reading year for me, with a number of partially-read books at the beginning of the year, squeezing in a few pages in my tent while roadtripping across the western U.S., and then finally powering through a few more books once life settled down a bit. Eleven books finished in total, assuming I’m not missing anything. This year I’m going to try being a bit more…

What I'm Doing Now

I’m in Austin, Texas. I spend all of my time on these things: Working on my start-up, CollBox (winner of the $100,000 QuickBooks Connect Hackathon). The above are my priorities right now. Other tasks I find worth spending time on: Writing the occasional blog post to share ideas and clarify my thinking. Dabbling in music production. Releasing / maintaining open source projects. Staying in…

Project: honeybadger for Clojure

TLDR: I’ve just released a pair of libraries which I believe constitute the best way to use the Honeybadger exception reporting service from Clojure– camdez/honeybadger and camdez/ring-honeybadger . I’ve been using weavejester’s ring-honeybadger in my projects, and while it has served me well, I end up rewriting the Ring integration every time because it’s not…

Practical Data Coercion with Prismatic/schema

If you follow me on Twitter , you probably know I’m a big fan of Prismatic’s schema library, which gives us a convenient way to validate and enforce the format of data in our Clojure applications. I use schema extensively both to provide some of the comfort / confirmation of a static type system, and to enforce run-time contracts for data coming off the wire. But a problem quickly…

About

Software developer, entrepreneur, dreamer & vagabond. I build CollBox, write a lot of Clojure, share code on GitHub, and rant on Twitter Mastodon. My home is Dallas, Texas Taipei, Taiwan Austin, Texas. I mostly write about code.

Dasherize HoneySQL Columns

Well… Korma didn’t work out … There are lots of things to like about it, but I honestly can’t deal with the fact that when you join on a belongs-to relationship, it simply merges all of columns into a single map ( :id-2 ?). Anyway, I’ve moved on to HoneySQL for now. Which still features the_kind_of_attribute_names only a database could love. Let’s kick that to…

Dasherize Korma Columns

A quick tip for the Korma SQL library for Clojure: By default, Korma will return column names with underscores (e.g. :this_kind , unmodified from the database convention), while Clojurists are likely more comfortable with :this-kind of dash-separated keyword. (Some people call this “kebab-case” vs. “snake-case”). To wit: ( defentity locations ( belongs-to user)) (select…

Talking Atheism on the Nerd Absurd Podcast

The lovely folks from the Nerd Absurd podcast had me on their show a couple months back 1 , along with my coworker Aaron , to discuss atheism and what it’s like growing up as an atheist in America. I founded–and for several years ran–The Atheists and Freethinkers Society at UT Dallas , an experience which left me with no lack of stories (both entertaining and infuriating) about…

The Parable of the Starchart

In my sophomore year of college I lived on campus with two roommates. Like so many other college roommates, we had a bit of a problem keeping the kitchen clean. We weren’t especially messy people on our own, but there’s something unfortunate that happens in shared spaces where responsibility is divided. Tasks without a single, clear owner tend to get ignored while everyone waits to see…

Private Ruby Gem Versioning

TLDR Don’t use version specifiers when referencing gems from git in your Gemfile. Use tags or refs instead. Most of the time when declaring our Ruby projects’ dependencies via a Gemfile, we pull our gems from a source like RubyGems.org: source 'https://rubygems.org' gem 'rails', '4.1.0' In this case you nearly always want to specify a version number for each gem to keep bundle update…

Automatically Installing Your Emacs Packages

The interactive list-packages command in modern Emacsen is handy for finding and trying out new packages, but once we’ve found packages we want to use, how can we have them automatically installed on all machines where we use Emacs? There’s a decent Stack Overflow question on the topic, but I want to dig into the various answers a bit and provide a slightly cleaner (IMHO) code snippet.…

Switching to MELPA Stable: Why, How, What I Learned

Background Writing my first Emacs package a couple months ago left me more cognizant of how Emacs’ packaging system is put together and raised questions about how I use its capabilities. I had been installing all of my packages from MELPA , but now, as a fancy-schmancy package author I’d become intensely aware that MELPA builds its packages based on the latest commit in a…

Goal Refactoring Insights

In IOI#1 I mentioned “goal factoring”. In a nut, the idea is to apply a consistent, rational process to the goals you’re thinking of setting for yourself to ensure they’re appropriately sized, likely to succeed, and the best path to the underlying thing that you want to accomplish. I’m currently working on my own goal definition / factoring process, but I wanted to…

Résistez à la Résistance

I awoke this morning to a text message from an old friend with a rather sharp tongue: Lol. You’ve gotta stop it with these Facebook posts. I knew exactly what it meant. It stung a bit because it was precisely what I worry about: I have a tenuous relationship with Facebook because there’s a disconnect between the people I know & consider (Internet) friends, and the interests I have. I…

Items of Interest #2

A round-up of interesting links from my recent internet travels.

Emacs Hangouts

Two weeks ago I had the pleasure of participating in an Emacs-themed Google Hangout arranged by Sacha Chua , in which several of us Emacs geeks got together and discussed what we’ve been working on, questions we have about particular packages or workflows, etc.:

μProject: checkbox.el

I’ve been playing with Emacs in the evenings lately and writing a lot of Elisp, and I just finished a little Emacs package for quickly manipulating textual checkboxes ( [ ] / [x] , etc.) in buffers, like a simple version of org-mode ’s task manipulation, but available everywhere. It’s called checkbox.el .

Solving Problems Rationally a.k.a. Optimizing Dick Van Dyke with Fluid Dynamics

From 2006 to 2009 I worked for a company called Tektronix on the 9th floor of a curvilinear glass-and-concrete tower in Richardson, Texas. My division built network monitoring solutions for Fortune 100 companies like AT&T “that enable[d] network operators to more strategically and profitably operate their businesses”—which sounds like fairly memorable work, but more than anything, I…

μProject: resque-backtrace

I was trying to debug a Resque job recently and I was actually quite surprised to find that it didn’t print backtraces on exceptions. Now, in production you’re definitely going to using an exception tracker like Honeybadger or AirBrake, but you probably won’t be doing so in development, so there’s nowhere at all to view backtraces when things go wrong. I threw together a…

Items of Interest #1

A round-up of interesting links from my recent internet travels.

Emacs: Rapid Buffer Navigation with Imenu

Kris Jenkins wrote a great post last month about rapidly navigating Clojure files in Emacs using Helm –definitely check it out. Helm is near the top of my list of Emacs extensions I need to explore, but in the meantime I thought I’d point out that’s there actually a great solution for this use case in a stock Emacs installation– imenu-mode .

Emacs: Jump to Info from Command Documentation

One of the coolest things about Emacs is that it’s self-documenting. What this means is that for any piece of functionality in Emacs, we can ask the editor about that thing. We can ask it to tell us about any function (C-h f), variable (C-h v), key binding (C-h k) or even the mode(s) we’re currently in (C-h m). Most of the time this documentation is comprehensive and heavily…

Emacs: Show Buffer File Name

I share my Emacs configuration on GitHub, but the truth is that most of the fun stuff happens in my experimental.el file (mentioned previously), which I don’t share. It’s growing rather large and some of the contents are fairly mature so I’m going to going to work on moving more things into my stable config and I may as well share them along the way. One little utility I’ve…

Apple Predictions & Development Pace

Apple’s pace of development is a curious thing. At times like the iPad launch, Apple seems completely ahead of the game. At other times their rate of advancement seems frustratingly slow. Apple will lead the way on faster WiFi standards, better displays, better battery life, voice control, or even new device classes, but not issue fairly basic updates to iOS’s home screen or photo…