Craft By Zen

πŸ‘‹πŸ½ Hi! This is Jeremy's Craft by Zen


  • jscodeshift Object Destructuring
    Posted

    The shorthand option is must be used in object destructuring to remove redundant prop: value to be prop.

    What I wanted was this shorthand:

    const { asFragment } = render(container);
    

    But what codemod generated was the following:

    const { asFragment: asFragment } = render(container);
    

    While both are true, I would rather have the shorthand, as that’s what we have strictly for eslint rules. This Github Issue helped describe the solution on how to implement in your transform file.

    const code = j.objectProperty(j.identifier("h"), j.identifier("h"));
    code.shorthand = true;
    
    j.variableDeclaration("const", [
      j.variableDeclarator(
        j.objectPattern([code]),
        j.callExpression(j.identifier("require"), [j.identifier('"packagename"')])
      ),
    ]);
    
    Filed: 🚰 Stream
  • 2024 Week 25 - Weekly Notes
    Posted

    Perplexity AI lying about their user agent, senior engineer fatigue, creating my first VSCode snippet, cutting an onion, and RIP Donald Sutherland and Willie Mays.

    Filed: ✍🏼 Writing
    πŸ”– weeknote
  • Embed TikTok videos in Obsidian
    Posted

    How to embed TikTok videos in Obsidian’s editing/live preview and reading mode.

    <iframe
      src="https://www.tiktok.com/player/v1/7382225350710824222?autoplay=0"
      allow="fullscreen"
      style="width:100%;height:50vh;"
    />
    

    where 7382225350710824222 is the video id you get from TikTok from this example link: https://www.tiktok.com/@_jen_hamilton_/video/7382225350710824222.

    The TikTok v1 player has a bunch of controls that you can use to modify from this documentation.

    There’s still some wonky height issues, and I suspect this is the default height Obsidian has on the container around the editor. I gave it a good enough viewable height of 50vh, which should be enough.

    Example Video

    Filed: 🚰 Stream
  • Running ESM on Node REPL
    Posted

    d3 v7 is packaged as ESM only. That made it difficult to use in the Node.js REPL. From this StackOverflow thread, I found a solution.

    let d3;
    import("d3").then((module) => {
      d3 = module;
    });
    // Then you can use d3 anywhere once the promise is resolved.
    
    Filed: 🚰 Stream
  • Posted
    Director: George Miller, Released: 2024
    As the world fell, young Furiosa is snatched from the Green Place of Many Mothers and falls into the hands of a great Biker Horde led by the Warlord Dementus.
    Filed: 🎞️ Films
  • 2024 Week 24 - Weekly Notes
    Posted

    Keeping a dev journal, book recommendations, how computers reduce efficiency, introduction to jhanas, some podcast notes about AI companies, and how do dogs see color.

    Filed: ✍🏼 Writing
    πŸ”– weeknote
  • Retrieval-Augmented Generation (RAG)
    Posted

    An explainer for Retrieval-Augmented Generation (RAG). Breaking down what it is and how people are implementing it.

    Filed: ✍🏼 Writing
    πŸ”– learning   ai
  • Package Dependency for @observable/plot
    Posted

    Extremely esoteric bug. I’ve had an open issue for the past three months related to this other issue. I couldn’t figure out why npm’s registry would pull an older version of d3-scale-chromatic when I upgraded the @observable/plot library. As a future note for myself, if I run into this issue again, I’ll have to go into the package-lock.json file and update d3-scale-chromatic to v3.1.0.

    Filed: 🚰 Stream
  • 2024 Week 23 - Weekly Notes
    Posted

    A change in format for weekly notes. Local rumblings like H5N1, international splashes with China's Internet disappearing, could AI solve science, the smart web could use our support, and engineering the slow internet from a user from Antarctica.

    Filed: ✍🏼 Writing
    πŸ”– weeknote
  • Stochastic Parrots
    Posted

    From this ACM paper, On the Dangers of Stochastic Parrots, the hypothesis is maybe these LLMs are parroting back what we already know and aren’t learning. We can probably, maybe, safely say that is no longer the case.

    Filed: 🚰 Stream
    πŸ”– politics
  • A Surprise "May" Be Afoot
    Posted

    Newsletter - Short Edition

    Filed: ✍🏼 Writing
  • 2024 Week 22 - Weekly Notes
    Posted

    Just Married!

    Filed: ✍🏼 Writing
    πŸ”– weeknote
  • 2024 Week 18 - Weekly Notes
    Posted

    Bye bye, corporate open source, spaced repetition explained as a in cartoon, cyberattacks on healthcare, AI Developer marketing ploy?, and a bunch of lay-offs and obits.

    Filed: ✍🏼 Writing
    πŸ”– weeknote
  • Students Have the Right to Protest Apartheid
    Posted

    From The Progressive: Students Have the Right to Protest Apartheid. My lovely fiancΓ© wrote a piece about the student protests for Palestine.

    While the Republican-led Congress has used its power to condemn any protests on behalf of Palestinians, where was the same outrage and zealousness when white nationalists came to college campuses?

    Filed: 🚰 Stream
    πŸ”– politics
  • What Works Today
    Posted

    Just start. You know enough to get started. Don't stray away from the path you set out.

    Filed: ✍🏼 Writing
  • April 2024 Updates
    Posted

    Newsletter updates for April 2024 - nature messing with its switch

    Filed: ✍🏼 Writing

I'm currently leading application development at Clear Labs.

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


πŸ”– Top 10 Tags


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.

Powered by Buttondown.