Craft By Zen

👋🏽 Hi, I'm Jeremy

I'm currently leading application development at Clear Labs

And I write essays on eclectic topics, from programming, cooking, and strange habit of collecting obituaries.


  • TIL importmap

    I forked a small demo from Wes Bos and ran in on my own sandbox. It seems much cleaner than using a script tag per each dependency, and works on all major browsers.

    In my little demo app, I placed the importmap in the head of the document. I’m using react as well as my own utils file to test out the functionality.

    <script type="importmap">
      {
        "imports": {
          "react-dom": "https://esm.sh/react-dom",
          "react": "https://esm.sh/react",
          "utils": "./utils.js"
        }
      }
    </script>
    

    Read more about importmap on MDN

    From there, I imported these libraries in a script module.

    <body>
      <div id="app"></div>
      <script type="module">
        /* eslint-disable */
        import { useState } from "react";
        import { createRoot } from "react-dom";
        import { formatMoney } from "utils";
        createRoot(document.querySelector(`#app`)).render(formatMoney(100.2365));
      </script>
    </body>
    

    I had a hiccup with [plugin:vite

    ] as I found countless others have, so I wrote a custom bun server to host this project. Hopefully there’s a better setup I can find with Vite using importmap in the future.

  • Start and end of day offsets for current system time zone offset using Luxon

    Luxon datetime library defaults startOf and endOf methods to UTC. But this isn’t great for end users who don’t live in UTC / GMT. To offset this, we need to grab the time zone offset from the user’s system.

    const systemTimeZoneOffsetInMinutes = new Date().getTimezoneOffset();  
    const systemTimeZoneOffsetInHours = systemTimeZoneOffset / 60;
    

    Then we can add the offset to the Luxon datetime object.

    const now = DateTime.now();
    const startOfLocalDay = now.startOf('day').plus({ hours: systemTimeZoneOffsetInHours });
    const endOfLocalDay = now.endOf('day').plus({ hours: systemTimeZoneOffsetInHours });
    
  • The "Boring" Stack

    I was listening to this podcast: The boring JavaScript stack featuring Kelvin Omereshone (K.O.O) (JS Party #319). My takeaway is I should be using a boring stack to build my business ideas. Leave the shiny new toys for tinkering and use something stable.

    While Kelvin talks about the benefits of using Sails, I was thinking about the other “boring” things that constitute a boring stack. It goes beyond tecnologies, like how to run a business, how to organize your team, and how to market the product. And when those things are boring, they are unsexy and oftentimes neglected.

    Related: Kelsey Hightower’s nocode

    The best way to write secure and reliable applications. Write nothing; deploy nowhere.

  • Screenshot of uuid tool

    Guitar Fingering Tool

  • Screenshot of uuid tool

    UUID Tool for easy generation of UUIDs (v4)

  • Screenshot of tech tree

    Visualized Technology Tree, templated for easy customization, with the help of ChatGPT.

  • Screenshot of piano app

    A playable piano

  • Created by: Brad Frost
    When designing from the ground up, create small, atomic components that can be combined into bigger components. Using biology as a guide, the complexity is organized into molecules, organisms, then pages. Templates are also used as layouts for those pages.
  • Created by: Gwern Branwen
    Gwern Branwen is a freelance American writer & researcher.
  • Created by: Rachel Roddy
    Rachel Roddy condenses everything she has learned about Italy's favourite food in a practical, easy-to-use and mouth-watering collection of 100 essential pasta and pasta sauce recipes.
  • Created by: Debra Fraiser
    Debra is the author and illustrator of many award-winning picture books including On the Day You Were Born and Miss Alaineus, A Vocabulary Disaster. In addition to her well- known talks on creative process, Debra’s innovative "Book Events" build a community’s creativity through projects that start with a story.
  • Created by: Cord Jefferson
    A novelist who's fed up with the establishment profiting from "Black" entertainment uses a pen name to write a book that propels him into the heart of hypocrisy and the madness he claims to disdain.
  • Created by: Dave Pell
    A newsletter offering a quick and entertaining look at the day’s most fascinating news.

Newsletter Series

I have put back together my newsletter after years of absense! These are primarily updates on my blog, "Craft By Zen", and maybe some highlights to the new articles I've written. There might be some life updates as well. I'm doing away with the old format of weekly longform essays, and trying some new things with my newsletter.

Read more in the announcement.

Powered by Buttondown.