On and off for the last year or so I’ve been learning SwiftUI and experimenting with a couple of app ideas. One that has come a long way and I’ve been asking friends and family to help me test is WeatherDate!
WeatherDate helps you track the weather for important events. Have a trip coming up and not sure what to pack? Have an outdoor event in a few days and want to keep an eye on the rain? Then I think you’ll find WeatherDate very useful.
Its been a few years since I last participated in Advent of Code, and I actually forgot about it until I saw some folks mention it on Mastodon. I’ve also been working on my Swift + iOS development skills this year, contributing to Pocket Casts iOS a few hours a week in addition to my regular web dev work at Automattic.
So I decided I’d take up Advent of Code again this year and use Swift to solve all the coding challenges to improve my skills a bit more. All of my Swift development so far has been in Xcode, but I also enjoy using Vim as much as possible. Since I discovered the wonderful world of Vim plugins a few years ago and realized I could do everything I enjoy in vscode right in a terminal window I’ve been using it as much as possible for smaller projects. It is something I like to do since the more comfortable and familiar I get with vim the less awkward it is to do more complicated work directly on the server when needed. Anyways, after solving the first 2 days of coding challenges, I decided that I needed some syntax highlighting in Vim because I was making silly mistakes that could have been avoided if every character on my screen wasn’t the same colour.
I went to my favourite vim plugin repository, VimAwesome, and searched for Swift. I was surprised to see, about 5 results down, that there was an official Apple vim plugin. Its buried a few levels deep in the Swift repo but it works, and its pretty awesome. It just wasn’t very straight forward to setup. Simply installing the repo as a plugin didn’t work, and after reading up on the documentation for vim-plug I discovered you can target a subdirectory in a repo.
Plug 'apple/swift', { 'rtp': 'utils/vim' }
… and just like that my monotone green editor window is now full of productivity-inducing syntax highlighting!
Before
After
And since I already had ALE installed all I needed to do was install SwiftLint and SwiftFormat and I’ve got linting and formatting ready to go as well.
I’m not really sure there is a singular proper way to learn anything, but I do know that there is a way that I learn things and that is through doing, not reading. So instead of messing around reading tutorials or massive O’Reilly books again (I think I’ve tried that twice over the years) I’ve decided to take a stab at “properly” learning iOS once again.
This time around I am following Paul Hudson’s 100 Days Of Swift. It is a 100 day video tutorial walking you through learning Swift and then iOS development. The initial 10 day Swift tutorial was a little basic for someone who already understands programming concepts, but it was a good introduction to the Swift way of doing things. I’ve reached day 62 so far (which I completed in far fewer days as I’ve found I can do a few days worth of the course at a time) which had me learning UIKit and various other iOS frameworks and I feel pretty confident about starting a new app, and adding what I need to in order to get the job done… supplementing with web searches when I get stuck.
There is still a lot to learn though, but I feel like I’m at a good spot where I could maybe dive into an existing code base, figure things out and start contributing to a REAL project. That is eventually my goal at least. For the time being I’ll wrap up the rest of these “100 days of Swift”, maybe dive into some SwiftUI and put together a real, honest-to-goodness modern iOS app!
For anyone looking to try out iOS development, or just development in general, 100 Days of Swift is a pretty comprehensive program and its FREE! The pace in the beginning is very good and introduces basic programming concepts pretty clearly. For anyone looking to speed through it if the pace is a little slow, I would recommend purchasing “Swift in Sixty Seconds” and “Hacking with iOS” from the Hacking with Swift website as they are the videos that the free course is based on. They include all of the videos and you can play them automatically back-to-back instead of having to click through the pages and interact with the YouTube player for every lesson.
This post was just sitting in my drafts presumably waiting for me to add to it… then a year went by and I did nothing with it.So here it is now, better late than never.
I’m not sure when this site just became an announcement blog for my work projects (I really need to start writing more), but I’ve got yet another fun WordPress block to be proud of… the Applause Block!
Today my team launched our second WordPress block, the Vote block! The vote block lets your readers up or down vote content on your page that you’re looking for feedback on. You can already use it on your WordPress.com site or download the plugin for your self-hosted site here
That may be a bit of an exaggeration, but I’ve just imported the entire archive of my old blog at johncaruso.ca to this site. It was about 360 posts that date back to 2004 when I used to ramble on about mundane day to day things I was up to.
Its been fun to re-read some of those posts and reminisce, but at the same time, there are a bunch of formatting issues I now have to deal with since it was a completely custom site before and I had some weird css to make certain things (like code snippets) look just right. I’ll need to groom those posts and fix whatever needs fixing.
At the same time, it was a fun little exercise to generate a WordPress compatible XML file to export my old blog database to. Now I just need to generate the URL rewrites from my old site to point here so I can remove those posts from there and clean up that site a bit.
My team over at Crowdsignal has been working on a cool new poll block plugin for WordPress called Crowdsignal Forms. We officially launched it this week for self-hosted WordPress sites and on WordPress.com! Please go check it out if you’ve got a WordPress blog or website.
The clipboard on my iPhone is something that I never really gave much thought to. Copy & Paste, it always just worked when it was there. It took until iOS 3 for it to be introduced, but since then, as a user, I never actually had to worry about it. That was until I installed the iOS 14 beta and I started noticing a new banner appear at the top of my phone whenever I pasted something.
I thought, that’s interesting, my iPhone is telling me when I paste something and where it came from. But then I started noticing it show up immediately after I opened certain apps. Apps that out of convenience would check my clipboard for me to see if there was, for example, a tracking number in there to automatically add it to my parcel tracking list. But that got me thinking, what if that was a password that I recently copied from my password manager? Would I want my post office to see the password to my email account or my company login? And while maybe I can trust my post office to not do something nefarious with what they see in my clipboard, are other apps so trustworthy?
So I decided to look into the feasibility of creating an iOS app that would read the clipboard (when you ask) and clear the clipboard at the tap of a button. After a few DuckDuckGo searches (I don’t Google anymore, more on that another time) and poking around in the Apple developer docs, it turns out its not that hard (literally 1 line of code for each action). So I downloaded the latest XCode beta and started putting together a simple iOS app with 2 buttons and a label, and I ended up with what I’m (for now) calling Clipboard Cleaner.
It is super simple right now, looks like trash, doesn’t even have an icon, but it works. It shows me whats in my clipboard if I’m curious, and clears it for me at the tap of a button. Its a bit of a nuisance since I have to open it before I can clear anything, so I’m thinking of adding some convenience features to make it a little easier to do (like a Siri shortcut, or maybe an iOS 14 widget).
I’m not sure if I’ll put this app up in the App Store or not, it works well enough for me as-is, and it would need a bit more polish before it would even make it through app review. And since I don’t really want to keep it to myself, and since its so simple, I’m making the code public so others can see, maybe learn, and since starting to work at Automattic I’ve been trying to embrace open source. And who knows, maybe someone will want to help add features to it, and it will hopefully get better being out in the open than hidden on my computer.
But why stop there? I also thought I might want the same thing on my laptop. While other apps can probably sniff the clipboard whenever they want (not just when they’re opened), so its maybe less necessary to have, I wanted take a shot at creating a Mac menu bar app with the same features. Having no experience creating MacOS apps either I jumped back on DDG and found this fantastic article on creating a Mac menu bar app. It took a bit more finessing since the latest XCode beta has a new option for creating apps that the article didn’t mention (I needed to select AppKit from the Life Cycle dropdown), and the clipboard API has a different name, but other than that it wasn’t a huge fuss to put together. And so, Clipboard Cleaner for Mac was born.
I’m looking forward to adding more to Clipboard Cleaner (and coming up with a better name), but I’m not sure on what kind of timeline. It feels good to have a small project I can poke at whenever I want, and to have something I made that I can take around with me in my pocket on my phone.
In the spirit of John making things, I’ve recently turned my gaze on the unnecessarily long list of domain names that I’ve collected over the years. I’ve moved between several different registrars at different times in the last 15 or so years, and have even spread out some domains in different places depending on the specific pricing and availability of non-standard TLDs like .be (for snpt.be, which was to be the url shortener for sniptube.com, a YouTube video concatenating site that I never actually launched).
The problem with having so many domains in so many different places is its hard to actually see what you have, and when they expire. The only time you really notice is when the registrar notifies you its up for renewal, and even then I may not pay attention because everything autorenews anyways.
As is my way, my attempt to solve this ‘problem’ wasn’t to just get rid of domains I don’t need anymore, or consolidate them on a single service (which won’t work for all domains because of pricing and availability… that pesky .be domain), but instead to build yet another web app.
Enter the Registrar Registry
I took a look at the different registrars I was using and 3/5 of them had APIs that I could use to query for a list of domains and expiry dates (the other 2 registries have been put on notice, and I’ll be switching off of them as the domains reach their expiry dates). So I started up vim (a new obsession of mine), created a new node/express app, and started making api requests.
I’ve decided to call this little app the Registrar Registry, and because it gives me Domain Data I’ve nicknamed it R2D2 (Disney, please don’t sue me). It connects to 3 of my registrars, pulls down my domain data and lists it out along with expiry dates, which I’ve beautified with momentjs to give me a nice human readable timeframe of when it is set to expire (expires in 15 days, expires in 9 months).
I’ve got this all up in a private GitHub repo that I’m planning on making public very soon incase such a tool would be useful to anyone else. And I’m hoping if it is, that this “someone else” might contribute a registry API connection if they happen to use a registrar that I haven’t added support for yet.
I’ve been sitting on about 4 lbs of green coffee beans that I got as a secret santa gift at work last Christmas. I tried roasting on a skillet over my bbq this winter, but it was way too inaccurate and I just ended up burning the outside of the beans and not roasting the inside (which made something that caused my grinder to cry instead of making something drinkable).
I eventually got a proper roaster for my birthday and now I’m spending a couple nights a week sitting in my garage over this beautiful machine, breathing in the sweet smell of caramelizing sugars.
Its taken about 7 batches, almost 2lbs worth of beans, but I’m starting to get the hang of it. I’ve been keeping a detailed log of things like fan and power settings, time between changes of those settings and even outdoor temp which I started noticing has been affecting how fast the roast progresses. My roast this evening, which followed the exact same steps as my roast from last night, was ready a full minute earlier and the only difference was the outdoor temp was 3C higher.
I’m really hopeful for this evening’s roast, which for the first time had a decently audible first crack and ended with a pretty even medium brown colour (pictured first) vs my very first roast which is super uneven (middle) and my french roast (bottom) which wasn’t supposed to be a french roast but I got carried away listening to second crack and waiting for my timer instead of paying attention to the roast colour.
City+ (I think)
Not Quite City (very uneven)
French Roast
I’ve been keeping pretty good logs, and once I’m at a place where I can do things fairly predictably I’ll post my steps, favourite beans and tricks I’ve picked up along the way. For now, I’ve ordered a couple more pounds of green beans, including some Jamaica Blue Mountain as a reward and test for when I feel I’ve gotten good (well, good enough) at this.