<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog on Daniel Lemky</title>
    <link>https://daniellemky.com/blog/</link>
    <description>Recent content in Blog on Daniel Lemky</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 31 Jul 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://daniellemky.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Giving Pi a Mobile Interface</title>
      <link>https://daniellemky.com/posts/giving-pi-a-mobile-interface/</link>
      <pubDate>Fri, 31 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://daniellemky.com/posts/giving-pi-a-mobile-interface/</guid>
      <description>&lt;p&gt;I use &lt;a href=&#34;https://github.com/earendil-works/pi-mono&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Pi&lt;/a&gt; for most of my development work. I often have multiple Pi sessions running across different projects, sometimes with an agent working for a while before it needs anything from me.&lt;/p&gt;&#xA;&lt;p&gt;That works great while I&amp;rsquo;m at my computer. However, I find myself often wanting to be able to kick something off or send a note to agent that is connect to my project management software while away from the computer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Edit Rails Credentials with Neovim</title>
      <link>https://daniellemky.com/edit-rails-credentials-with-neovim/</link>
      <pubDate>Sun, 14 Sep 2025 04:34:50 +0000</pubDate>
      <guid>https://daniellemky.com/edit-rails-credentials-with-neovim/</guid>
      <description>&lt;p&gt;These instructions will allow you to edit your Rails credentials file using Neovim.&lt;/p&gt;&#xA;&lt;p&gt;Run the following command from your Rails application:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;VISUAL&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;nvim bin/rails credentials:edit&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Neovim runs in the foreground, so it does not need a separate wait option. Rails will wait until Neovim exits before continuing.&lt;/p&gt;&#xA;&lt;p&gt;When you are done making your changes, press Escape to return to Normal mode, then enter &lt;code&gt;:wq&lt;/code&gt; to save the file and quit Neovim.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working with Hotwire Native # 4</title>
      <link>https://daniellemky.com/working-with-hotwire-native-4/</link>
      <pubDate>Fri, 04 Jul 2025 05:01:00 +0000</pubDate>
      <guid>https://daniellemky.com/working-with-hotwire-native-4/</guid>
      <description>&lt;p&gt;&lt;strong&gt;iOS Push Notifications&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This went relatively smooth. I fought a bit with the .p8 file for the token and setting up the configuration for the connection, but that was likely because I it was 5:30am and I had stayed up all night working through the Hotwire Tab issues.&lt;/p&gt;&#xA;&lt;p&gt;Taking a couple extra minutes and reading through the apnotic gem docs was all I really needed to do.&lt;/p&gt;&#xA;&lt;p&gt;Claude Code was surprisingly helpful on the iOS side for setting up a PushNotificationManager which handles requesting notification permission and registering the device token.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working with Hotwire Native # 3</title>
      <link>https://daniellemky.com/working-with-hotwire-native-3/</link>
      <pubDate>Wed, 02 Jul 2025 05:00:00 +0000</pubDate>
      <guid>https://daniellemky.com/working-with-hotwire-native-3/</guid>
      <description>&lt;h2 id=&#34;conditional-hotwire-tabs&#34;&gt;Conditional Hotwire Tabs&lt;/h2&gt;&#xA;&lt;p&gt;I wrote a custom tab bar controller that does a quick session check to determine which tabs should be shown. So far, this seems to be working well enough that I may not need OAuth.&lt;/p&gt;&#xA;&lt;p&gt;Authentication and authorization are still enforced by Rails. The native tab controller uses the presence of the Rails session cookie as a quick UI hint for which tabs to display, but the cookie check is not treated as proof that the user is authenticated. Rails remains the authority for every request.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working with Hotwire Native # 2</title>
      <link>https://daniellemky.com/from-rails-app-to-to-ios-app-with-hotwire-native-log-2/</link>
      <pubDate>Mon, 30 Jun 2025 04:59:00 +0000</pubDate>
      <guid>https://daniellemky.com/from-rails-app-to-to-ios-app-with-hotwire-native-log-2/</guid>
      <description>&lt;p&gt;I stepped away from the iOS app for a number of weeks to implement some other features for Missionbase. I particularly wanted to have Web Push Notifications working—which is now in place and working well. The Rails notification logic should also serve as a base for iOS Push Notifications, although native delivery will still require a separate APNs integration. Anyway, I got back to work on the Hotwire Native side of things this past week and made some decent progress.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Working with Hotwire Native # 1</title>
      <link>https://daniellemky.com/from-rails-app-to-to-ios-app-with-hotwire-native-01/</link>
      <pubDate>Tue, 20 May 2025 03:44:09 +0000</pubDate>
      <guid>https://daniellemky.com/from-rails-app-to-to-ios-app-with-hotwire-native-01/</guid>
      <description>&lt;p&gt;Documenting my experience taking a new Rails app (Missionbase) to the iOS app store.&lt;/p&gt;&#xA;&lt;h2 id=&#34;days-1-3&#34;&gt;Days 1-3&lt;/h2&gt;&#xA;&lt;p&gt;Saturday, May 17, 2025 to Monday, May 19, 2025&lt;/p&gt;&#xA;&lt;h3 id=&#34;progress&#34;&gt;Progress&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set up Xcode project for Missionbase&lt;/li&gt;&#xA;&lt;li&gt;Set up the project with Hotwire Native for iOS dependencies&lt;/li&gt;&#xA;&lt;li&gt;Got app running in simulator and on my iPhone.&lt;/li&gt;&#xA;&lt;li&gt;Got app running using both production and local development servers.&lt;/li&gt;&#xA;&lt;li&gt;Tried to customize the top UI navigation title. It&amp;rsquo;s not working the way I wanted it so I&amp;rsquo;ve left it to the default for now.&lt;/li&gt;&#xA;&lt;li&gt;Implemented navigation tabs. This was the most straightforward part of anything so far.&lt;/li&gt;&#xA;&lt;li&gt;Sort of got path-configurations working.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;thoughts&#34;&gt;Thoughts&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;AI isn&amp;rsquo;t very helpful for this.&lt;/strong&gt; I would think it&amp;rsquo;s likely because Hotwire is still quite new and there isn&amp;rsquo;t a whole lot of documentation around it. But unfortunately it hasn&amp;rsquo;t been able to help me accomplish anything.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;A lot of unclarity for any customization.&lt;/strong&gt; The basic &lt;a href=&#34;https://native.hotwired.dev/ios/getting-started?ref=daniellemky.com&#34;&gt;Hotwire Native iOS walkthrough&lt;/a&gt; helped get me set up and get the app running in development mode on my iPhone, but making even minor customizations hasn&amp;rsquo;t been easy. From what I&amp;rsquo;m finding so far, it seems like knowing Swift really is a requirement if you want to do anything beyond the defaults.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Xcode is awful.&lt;/strong&gt; I&amp;rsquo;ve found using Xcode as an editor to be downright awful so I took some time today to set up Neovim for my Xcode projects. I found a good plugin called &lt;a href=&#34;https://github.com/wojciech-kulik/xcodebuild.nvim?ref=daniellemky.com&#34;&gt;xcodebuild.nvim&lt;/a&gt; which allows me to perform builds, run and clear using commands right within Neovim. This has already immensely improved my development happiness.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;I&amp;rsquo;m going to have to learn Swift.&lt;/strong&gt; Coming into this I had the idea that I might be able to get by without doing much iOS development. Wrong. While getting a working app was pretty easy, getting this app approved in the app store seems very unlikely without knowing a good amount of Swift. This is largely because this app is a subscription-based app, so I have to figure out Apple&amp;rsquo;s subscription payments side of it. Perhaps if I was working with just a free app, this would be much easier.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;issues-ive-run-into&#34;&gt;Issues I&amp;rsquo;ve run into&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dev server issue.&lt;/strong&gt; I couldn&amp;rsquo;t use &lt;code&gt;localhost:3000&lt;/code&gt; from my iPhone because &lt;code&gt;localhost&lt;/code&gt; refers to the phone itself. I used the Mac&amp;rsquo;s LAN address instead: &lt;code&gt;http://192.168.1.56:3000&lt;/code&gt;. Rails also needs to listen on the network, so I started it with &lt;code&gt;bin/rails server -b 0.0.0.0 -p 3000&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Can&amp;rsquo;t customize the top navigation bar.&lt;/strong&gt; Hotwire, by default, sets up the iOS UI navigation title to use whatever the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; tag has set for the page in the Rails app. This is simple, but if you take a look at the screenshot, it means there&amp;rsquo;s redundant titles. There&amp;rsquo;s an easy to to handle this even just using Tailwind, but the issue I have is that there are other views in the app where I would like to have more information in that title area. For a Task for example, I would like to have the title of the task, along with the project it belongs to as a subheading. But I haven&amp;rsquo;t been able to attain this so far. It seems like I&amp;rsquo;ll need to set up some sort custom navigation views (or something).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://daniellemky.com/images/posts/missionbase-hotwire-native-01.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Date, DateTime, Time, and Time Zones in Ruby &amp; Ruby on Rails</title>
      <link>https://daniellemky.com/date-datetime-time-and-timezones-in-ruby-ruby-on-rails/</link>
      <pubDate>Sun, 05 Jan 2025 20:48:55 +0000</pubDate>
      <guid>https://daniellemky.com/date-datetime-time-and-timezones-in-ruby-ruby-on-rails/</guid>
      <description>&lt;p&gt;To Future Me (and anyone else who finds this useful):&lt;/p&gt;&#xA;&lt;p&gt;I can never seem to remember which Ruby and Rails date and time methods use the system time zone, which use the Rails application time zone, and which return UTC. This is my reference for keeping them straight.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;the-short-version&#34;&gt;The short version&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Date&lt;/code&gt; represents a calendar date. It does not contain a time or time zone.&lt;/li&gt;&#xA;&lt;li&gt;Ruby&amp;rsquo;s &lt;code&gt;Date.today&lt;/code&gt;, &lt;code&gt;Time.now&lt;/code&gt;, and &lt;code&gt;DateTime.now&lt;/code&gt; use the system time zone.&lt;/li&gt;&#xA;&lt;li&gt;Rails&amp;rsquo; &lt;code&gt;Date.current&lt;/code&gt;, &lt;code&gt;Time.current&lt;/code&gt;, and &lt;code&gt;DateTime.current&lt;/code&gt; use &lt;code&gt;Time.zone&lt;/code&gt; when one is configured.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;.utc&lt;/code&gt; when you explicitly need UTC.&lt;/li&gt;&#xA;&lt;li&gt;Prefer &lt;code&gt;Time&lt;/code&gt; for application timestamps. In Rails, application-zoned values are usually &lt;code&gt;ActiveSupport::TimeWithZone&lt;/code&gt; objects.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-calendar-dates-with-date&#34;&gt;1. Calendar dates with &lt;code&gt;Date&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;code&gt;Date&lt;/code&gt; contains a year, month, and day. It does not represent an instant in time and does not carry a time zone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>TypeError: Module specifier &#39;application&#39; does not start with &#39;/&#39;, &#39;./&#39;, or &#39;../&#39; in Rails with importmap-rails</title>
      <link>https://daniellemky.com/typeerror-module-specifier-application-does-not-start-with-or-rails-7/</link>
      <pubDate>Wed, 03 Apr 2024 18:30:05 +0000</pubDate>
      <guid>https://daniellemky.com/typeerror-module-specifier-application-does-not-start-with-or-rails-7/</guid>
      <description>&lt;p&gt;I was running into this error on some iOS devices in my Rails application:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;TypeError: Module specifier, &#39;application&#39; does not start with &amp;quot;/&amp;quot;, &amp;quot;./&amp;quot;, or &amp;quot;../&amp;quot;.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;application&lt;/code&gt; is a bare module specifier. This error means that the browser tried to load it without successfully applying an import map.&lt;/p&gt;&#xA;&lt;p&gt;In my case, the error occurred on older iOS devices because those versions of Safari did not support import maps natively. Native import-map support begins with Safari and iOS 16.4, so Safari and iOS 16.3 and earlier require a shim.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ruby indenting in Neovim</title>
      <link>https://daniellemky.com/ruby-indenting-in-neovim/</link>
      <pubDate>Tue, 19 Mar 2024 18:00:10 +0000</pubDate>
      <guid>https://daniellemky.com/ruby-indenting-in-neovim/</guid>
      <description>&lt;p&gt;One annoyance I had to work through when I started using Neovim was an auto-indenting issue for Ruby code.&lt;/p&gt;&#xA;&lt;p&gt;Whenever I would write a method, the first line inside the method that should be indented one step would be reset to align with the previous line as soon as I typed a &lt;code&gt;.&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# I would start by writing this:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;index&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;vi&#34;&gt;@posts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# But as soon as I entered a &amp;#34;.&amp;#34;, the indentation would change to this:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;index&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;vi&#34;&gt;@posts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;Post&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ruby&amp;rsquo;s buffer-local &lt;code&gt;indentkeys&lt;/code&gt; configuration includes &lt;code&gt;.&lt;/code&gt;, so typing a period tells Neovim to recalculate the current line&amp;rsquo;s indentation using the active &lt;code&gt;indentexpr&lt;/code&gt;. Tree-sitter&amp;rsquo;s indentation expression can then calculate the wrong indentation while the Ruby expression is still incomplete.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Measuring elapsed time with Ruby</title>
      <link>https://daniellemky.com/measuring-elapsed-time-with-ruby/</link>
      <pubDate>Mon, 30 May 2022 19:16:59 +0000</pubDate>
      <guid>https://daniellemky.com/measuring-elapsed-time-with-ruby/</guid>
      <description>&lt;p&gt;Over the weekend I was working on a side project and I found myself needing to improve the speed of certain methods, so looked up some ways to measure time in Ruby for this purpose.&lt;/p&gt;&#xA;&lt;p&gt;Several posts gave the obvious answer - set a &lt;code&gt;start_time&lt;/code&gt; variable at start, set an &lt;code&gt;end_time&lt;/code&gt; variable at end and calculate the difference. Easy. But not necessarily the best answer.&lt;/p&gt;&#xA;&lt;p&gt;The problem with that approach, which Luca Guidi in &lt;a href=&#34;https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/&#34;&gt;this blog post&lt;/a&gt; nicely spells out, is that &lt;code&gt;Time.now&lt;/code&gt; gets the current time from the system, but the system is not meant for measuring duration.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
