-
The Week #17
by- One of my side projects is running an air quality bot for the city of Houston called @Kuukihouston. Basically what it does is scrapes pollutant data from The Texas Commission on Environmental Quality, stores it in a databases, and tweets if thresholds are exceeded or updated to cross that threshold.
I noticed it hadn't tweeted in a while but appeared to be working. Surely the city Houston didn't suddenly stop dumping benzene into the air (though a man can dream). Turns out they TCEQ started returning 404 Not Found responses to my bot. I hadn't yet moved the server to Frankfurt to be powered by sustainability energy so it was a good excuse to move it and see if it would start working.
Sure enough after moving to a fresh ip address, Kuukibot came back to life and started tweeting again.
Sketch wrote a great blog post about why they're proud to be a native app. I wholeheartedly agree - software that's made for the Mac, not just on the Mac is always preferable. At the same time, with iOS and iPad apps coming to macOS with Big Sur and the ARM transition, I feel like even the "native" apps won't feel like Mac apps before we know it.
My buddy John at Trendsmap pointed me to a great blog post by Karl called Don't Contribute Anything Relevant in Web Forums Like Reddit. The basic premise is that closed forums tend to take your work, hide it from the wider internet, and eventually shut down β taking your work with it and without a real way to export it. Basically if it's important to you in anyway, put it on your own site. Publish (on your) Own Site, Syndicate Elsewhere
-
Checkin to Costco (γ³γΉγγ³)
Road snacks.
-
Checkin to Tully's Coffee
Used to visit this Tullyβs regularly in 2009 - 2011. These days not so much.
-
by
The sunset tonight in Yokohama is fantastic. Lovely Mt. Fuji. Days like this I really love where I live, never gets old. π π»
-
Checkin to Starbucks
by in Kanagawa, JapanFirst cup of black coffee in days.
-
Lazy Load Images Without Javascript
bySustainability of websites is mostly determined by how much electricity the website consumes. All websites consume electricity 24/7. There's a server powered up, listening for requests. They consume it by proxy transferring bits to the client and they consume it on the visitor's computer by rendering the content.
You can't do much about electricity consumption of a server being online 24/7 beyond simplifying your hosting infrastructure (you don't need a load balancer). What's easier to control is the the number of bits you send to clients who visit your website.
Images are a large source of unnecessary bits. We shouldn't be uploading raw uncompressed 40MB images designed for a poster to display on a smart phone. They'll load slow, chew through our visitor's data plan, and consume unnecessary electricity to transfer and render such a large image. You should resize your images for the web.
Traditionally images are input into a website with a simple image tag like below:
<img src="https://jamesvandyne.com/wp-content/uploads/2020/10/voted.png" alt="Ballot approved" border="0" width="600" >You tell the browser where the image is, give it some alt text for cases where the image doesn't display / accessibility purposes, and maybe even set a size. Once your browser encounters this tag it will dutifully download and display the image. Life is good.
But what if that image is halfway down the page and completely off screen? Doesn't matter - still downloaded.
It doesn't matter that they may not scroll down far enough to see the image, it's in your markup the browser downloads it. This is a waste of electricity and bandwidth.There are methods using Javascript to dynamically change the src attributes of your image tags when the user scrolls near, but then your simple image tag now requires Javascript and client side computation just to display. It's not an elegant solution.
Turns out there's a better way without Javascript using the loading attribute on your images. Support is in all major browsers since mid 2019 / early 2020. It works out of the box on Firefox/Chrome, but it must must be enabled in Safari under the Advanced > Experimental Features settings for now.
By simply adding
loading="lazy"to our image tags the browser will lazy load our images, i.e. it won't download the image until is nearly in view.So by modifying the example above to
<img src="https://jamesvandyne.com/wp-content/uploads/2020/10/voted.png" alt="Ballot approved" border="0" width="600" loading="lazy">we can reduce the number of data transfers, reduce total transfer size (unless they scroll the image into view), reduce electricity consumption across the board, and improve page load times. It's a win-win-win.
-
Thinking about Thinkpad
byI recently mused about how my next computer should be a Thinkpad running Debian. I still half-think that, but I feel conflict on the issue. Let me explain.
My first Mac was an iBook G3 running OS X 10.1 in 2002 and I've been on Apple computers exclusively since. I came from running desktop Linux (Gentoo at the time) and a major reason why I switched to OS X was the unix environment without the fiddling.
Over the years I starting developing native apps and valuing apps that take the time and effort to be consistent with the systems. The consistently between apps made the entire system feel cohesive and easy to use. "Mac Apps Behave / Are Designed Like This". I was hooked. I am hooked.
But the world has changed since those days. We're now connected to the net with fiber rather than dialing in for a ~couple~ all hours of the night. Web browsers have become the new platform to target and Every app is cross platform and nothing is native.
Hardware is a growing concern for me as well. Apple makes some of the best laptops. I look forward to the Apple Silicon Macs. But repairing your Mac often means replacing the entire unit and paying more than purchasing a new one. They're no longer upgradable and filled with glue.
Contrasting with Thinkpads you can upgrade the ram, swap out the hard drive, add in LTE modems, and even change the display. If something breaks you can replace just that part. Expandability should allow the machine to have a longer life. I can even get them fully supported with Ubuntu or Fedora Linux.
If the software I use on a regular basis no longer native, not designed for the Mac, and everything is inconsistent, what's the advantage of using them on the Mac?
-
The Week #16
by- I started experimenting more with IndieWeb Post Kinds. I tried a bookmark and a reply to James' post about RSS, but I'm not sure if it sent webmentions like it should've. One thing's for certain my blog needs some style adjustments - replies don't have enough space between them and the next post. Finding a good mapping between Wordpress "Kind" and the IndieWeb "Post Kind" is difficult, as well.
- I've rearranged the footer of my site. Site meta was deleted, Categories was moved to the right, and I've added post kinds to encourage me to use them more. While I backfeed all of my Swarm checkins to my blog, I filter them from my homepage and main rss feed as it creates too much noise. But I still wanted a place to list them on my site, so my most recent 5 checkins are listed as well.
- I've been ignoring my Bedtime and watching Long Way Up/Down/Round. While it's been good to have some time to travel with my mind it's been bad for daily energy levels. This week I'm going to try and get to bed on time so I can wake easier.
-
by
Surveillance capitalism is outlawed tomorrow: how does the web react? Do web directories come back? Does the web re-decentralize?
-
by
Ran along the river in Fujisawa today. Started in Fujisawa this time so didnβt need to run 3 km just to get there. Nice 5km. πππ»
