πŸ—» James Van Dyne

✈️Trips πŸ—ΊοΈMaps ✏️️Blog πŸ”—οΈοΈLinks πŸ‘‰Now πŸƒRuns
  • 🏑Home
  • ✈️Trips
  • πŸ—ΊοΈMaps
  • ✏️Blog
  • πŸ”—οΈLinks
  • πŸ‘‰Now
  • πŸƒRuns
  • ✏️Articles
  • πŸ“€οΈReplies
  • πŸ’¬Status
  • πŸ”–οΈοΈBookmarks
  • πŸ—ΊCheckins
  • πŸ“…The Week
  • πŸ–₯Tech
  • 🌲Sustainability
  • πŸƒRunning
  • 🧠Thoughts
  • πŸ‡―πŸ‡΅Japan
  • πŸ’‘TIL
  • β›°Tanzawa
  • 🏑Home
  • ✏️Articles
  • πŸ“€οΈReplies
  • πŸ’¬Status
  • πŸ”–οΈοΈBookmarks
  • πŸ—ΊCheckins
  • πŸ“…The Week
  • πŸ–₯Tech
  • 🌲Sustainability
  • πŸƒRunning
  • 🧠Thoughts
  • πŸ‡―πŸ‡΅Japan
  • πŸ’‘TIL
  • β›°Tanzawa
  • Tanzawa Strava Integration Merged

    Dec 30, 2022
    by James
    Just in time for the new years resolutions (and the last possible moment for me to hit one of my own 2022 goals), Tanzawa integrates with Strava via a new Exercise plugin. This initial release is the absolute minimal viable integration.

    This is what the admin screen looks like:
    It works like you'd imagine: click the Import from Strava button to import your latest activities. While it's storing the mapping data, it's not displaying them yet.

    There's also a public page that's added to display some stats of your running. It looks like this:

    Again, quite minimal. I even wrote some documentation for how to enable and set it up.

    Both of these pages will be evolving a lot over the coming weeks as I now have a foundation in Tanzawa for working with Strava data in place. On the admin site, I'm planning to add mapping and more detailed information. On the public side, I'm planning more statistics and comparisons, including some fun ones that'll help us track really big goals.

    If there's anything you think is a must have or some fun ideas that one could do with the data, I'd love to hear them!
    πŸ”—permalink 5 interactions
  • Dec 29, 2022
    by James
    in Yokohama, Kanagawa Prefecture, Japan
    Good morning Yokohama
    πŸ”—permalink 1 interaction
  • Checkin to Yokohama Royal Park Hotel (ζ¨ͺζ΅œγƒ­γ‚€γƒ€γƒ«γƒ‘γƒΌγ‚―γƒ›γƒ†γƒ«)

    Yokohama Royal Park Hotel (ζ¨ͺζ΅œγƒ­γ‚€γƒ€γƒ«γƒ‘γƒΌγ‚―γƒ›γƒ†γƒ«) 35.45450013159353 139.6314775943756
    Dec 28, 2022
    by James
    in Yokohama, Kanagawa, Japan
    A short trip in town for the night. Staying at the Royal Park Hotel again. Our view for the night.
    πŸ”—permalink 6 interactions
  • Checkin to Art Rink in ζ¨ͺζ΅œθ΅€γƒ¬γƒ³γ‚¬ε€‰εΊ«

    Art Rink in ζ¨ͺζ΅œθ΅€γƒ¬γƒ³γ‚¬ε€‰εΊ« 35.45200384353565 139.642417089241
    Dec 28, 2022
    by James
    in Yokohama, Kanagawa, Japan
    Getting some ice skating in with the fam. So hard. Leo’s doing good. πŸ™ŒπŸ»
    πŸ”—permalink 8 interactions
  • Dec 28, 2022
    by James
    The admin view for Tanzawa's Exercise plugin is coming along nicely.
    πŸ”—permalink
  • The Week #130

    Dec 27, 2022
    by James
    • Hard to believe that this is the last full week of 2022. I haven't yet gathered my thoughts for the year or made a roundup post as I usually do, but I'm relatively pleased with how the year's gone.
    • I finished work for the year on Wednesday. I think this might be my first big break since this time last year. Otherwise it's been days off here and there because someone needs to watch Leo or we're sick with Covid. I felt like I really needed this break a couple weeks ago, which means I waited too long to take proper leave.
    • The big event this week was the double-whammy of Christmas and my wife's birthday. We celebrated at the in-laws house with a small feast and cake on Christmas Eve. I went full American and made some rosemary-garlic roasted potatoes, a shredded carrot/apple/raisin salad, and cheeseball(!!). The cheese ball was only possible because my dad sent heaps of ranch dressing mix packets along with the heaps of Christmas cookies. So good. Much fat.
    • As we're planning to visit American we decided not to get presents for each other, but as usual, Leo scored. Santa brought him the Adventures with Mario Lego Starter pack. It's about 10x cooler than I had anticipated. The Mario actually takes batteries which powers some scanners in his bottom. He audibly/visually reacts to the color that he's standing on, e.g. on red, he makes noises like he's in lava, and blue like he's in water and so forth. Even cooler though is the goomba / ? blocks / Bowser Jr. have a barcode block on them that Mario reads and he makes sound effects, or gets an item. If you lay him down his gets sleepy and falls asleep.

      From mom and dad he got a Jet Kids carry-on luggage. It's cool as he can carry his stuff, but it can be placed in front of his seat to turn it into a kind of bed. Then we found out that United doesn't allow them to be used on any of their flights... As long as he's in the window seat, I don't think it'll be a problem if we use it (unless they explictly call it out when we board, otherwise I reckon we can just feign ignorance).
    • Side-project wise I merged that big refactor of Tanzawa's internals and it's working as anticipated – great.Β 

      I also added consumption scraping to Sunbottle. This means I can now see how much electricity I actually use again. I've started using it to show how much I generated and how much I consumed the previous days and it's quite handy. This feature sets the groundwork for me to start on the "billing" code, so I'll be able to have a page that shows how much my usage would've cost without solar.

      But as the billing code is a bit too much like work, I've shifted focus to another Tanzawa feature I stated as a goal at the start of the year, didn't start because of tech debt I've recently paid off ( aforementioned refactor and moving from Gunicorn to uWSGI): Strava integration. It's coming along nicely and I think it'll get in before the end of the year...which leads me to...
    • I've been subscribing to Apple's Fitness+ for ages, not on purpose, but because it's included in Apple Ultimate (or whatever the tier is called that gives you everything for cheaper than increased storage, music, and apple tv). I went for my first run using Time to Run, and it's great.

      Usually when I'm running I'd pick some music and a timer for 30 minutes or so and just go. You're left asking / deciding "what do I want to run to today?" or running into slow songs as the worst time. It's difficult to explain with words (and that won't stop me from trying!), but it is...like a coach in your ear and a tour of a city at the same time but it doesn't matter than you're not in that city.

      At the start of the run the coach explains the run (3 difference paces, repeated twice etc..) / the city/course that this run is based on. The music is set for the location, pace, and cut to match the different sections.Β  e.g. The first city was Miami, which has a large Cuban/Latino community, so all of the music was in Spanish and there was a nice 2 minutes of up-tempo song when it's time to run fast, slower songs when it's time to slow down etc..

      Just as important is the reminders between each section for what to focus on. Focus on your breath and keeping it steady. Use your arms, keep them close and use them like a second set of legs.Β 

      I've only used it once, but it made a 33 minute run fly by. Not having to select music is one less thing for me to think decide when running. Having story and photos of the location pushed my watch while I run is entertaining. The couching and encouragement while running, even if it's from an audio recording, is somehow quite motivating during the run.
    πŸ”—permalink
  • Dec 23, 2022
    by James
    The problem with having two fun side projects:
    Do I write the Strava integration for Tanzawa so I can get all of my running data (or lack thereof tbh) just so.Β 
    Or do I write some billing/electricity tariff calculations / #OctopusEnergy API integrations, so I can show just how much my solar / battery is saving me each month....
    I reckon Strava is more important/less like work code... We show estimated costs on our graphs...I bet I can use that instead of calculating things meself to start?
    πŸ”—permalink
  • Dec 23, 2022
    by James
    Remember how places like LiveJournal used to have "post flair"? They were effectively different emojis for your moodΒ  or the weather. I think there were even some music integrations so show the song you're listening to...I think I need that on my blog.Β  Weather could be done free with OpenWeatherMap/weather-icons. Music might be trickier...
    πŸ”—permalink 1 interaction
  • Editing Bookmark / Reply Titles with HTMX

    Dec 22, 2022
    by James
    This post is a followup to Allow editing of replies/titles and describes some of the changes made to enable this functionality (#265) and my thoughts after my first steps with HTMX.

    Unable to change bookmark / reply titles ☹️

    Above is the before state, which is a static view of title/url of a bookmark/reply. Below is aΒ  gif of what I built and the finished state. There's a new change button, which you can click to reveal a form that allows you to edit the record. This form allows you to save or cancel. Save updates the record and changes the screen back to the "read only" view, while cancel just loads the current "read only" view. Zero custom Javascript.

    Editing a bookmark url / title in Tanzawa

    Powering this is two new simple views in the admin site. One loads the entry's bookmark/reply and returns the read only view. The other loads the same record and displays a form on get, updates it on post.

    The htmx and these two small views were the simple part of this feature. The heavier lift was decoupling the Tanzawa micropub endpoint from the admin views/forms, and then updating the admin views to no longer expect IndieWeb extension data (reply/bookmark url/titles etc...) on update (it's still required on create).

    Thankfully I had functional tests for my micropub endpoint, so I could be confident that my refactoring didn't break existing functionality. Those tests allowed me to extract the logic from the admin forms and put them into a application function. This new application functions are reused by all interfaces creating/updating entries.

    The next phase was adding tests to the admin views and then updating them to use the common application functions. This work was mostly a slog because I needed to add tests and better factories for my tests before doing the actual refactor. There's still more improvement that can be made in the test factories to make them a bit more DRY, but they're good enough for now.

    Working with HTMX has been a dream. Rather than usingΒ  Javascript to tweak DOM, I can simply make calls to the backend to get html from the backend by adding just a couple of attributes to my template dom. All of this using the same django templates.

    My next steps with HTMX are going to be to look into integrating django-components, so I can wrap up the Javascript I do need with the their templates/css and do some more refactoring. For example, right now reply/bookmarks have effectively the same templates / views duplicated. Using components, I should be able to have a single logical component to power both.

    If the components strategy works, I will look at breaking out various parts of Tanzawa into htmx/django-components for easier maintenance e.g. the location selector or location view on the bottom of checkins.
    πŸ”—permalink
  • Response to Edit reply bookmark titles by jamesvandyne Β· Pull Request #265 Β· jamesvandyne/tanzawa

    Dec 21, 2022
    by James
    This PR started as an experiment with HTMX to allow Tanzawa to edit reply/bookmark titles. As all of the entry creation forms/views are inherited from similar base-classes for easy/speed of initial...
    I've re-worked all of the create/update views for each post type to use application functions and added functional tests. Editing the url/title for reply posts, works really well. HTMX is allowing me to create the simple interactions I want without Javascript.

    The biggest change is reply data is no longer updated all at once with the rest of the post, but rather when you finish editing the title/url, similar to how editing a GitHub PR title works.

    The last bit that I think needs some more work, unrelated to the rest main objective of his issue, is the first step when creating a reply where I request the URL to, and it uses Turbo to fetch the meta-data / return a page that can create a reply.

    This flow may need a bit more yak shaving so it doesn't use Turbo at all. Will give it a fiddle to see if I can refactor and simplify the flow using HTMX.
    πŸ”—permalink
Previous 83 of 357 Next
Reply by email
Powered by
πŸ”Tanzawa

← An IndieWeb Webring πŸ•ΈπŸ’β†’
Photo of James Van Dyne James Van Dyne Japan

Web developer living in Japan.