Categories
Applications Music

Spotify recommendations are spot on today

I’ve been listening to one of my Spotify Daily Mixes that comprises instrumental movie and TV soundtracks. It has been giving me some excellent choices, many of which I haven’t heard before.

I’m really impressed! Here are a couple tracks that have become new favourites:

If only my YouTube recommendations for videos were as accurate!

Categories
Applications Useful stuff

Exploring the Brave browser

A few of my colleagues have been raving about the relatively new, Chromium-based Brave browser lately, so I decided to try it out.

I initially didn’t pay much attention because I’m pretty happy using Firefox as my primary browser. That said, I like a browser that blocks tracker crud on the Web, so I thought I’d try it out.

The biggest plus for me is that the browser blocks trackers out of the box. It’s one of the reasons I’m a big Firefox fan – pretty robust tracker blocking from the start.

Brave puts performance, and security at the forefront, literally, with indicators of how much the browser is blocking as you journey across the Web, and how much time it seems to be saving as your browse:

I haven’t really compared Brave’s blocking stats with Firefox’s (I’m not sure if I can really compare them directly given that I just see totals, not a breakdown), but it is gratifying to see that value go up.

In Firefox, I set my start page as about:protections so I see this data each time I start up my browser, too:

If anything, these values are great reminders of how much cruft is on the Web, degrading our browsing experience.

Another aspect of the Brave model is how it uses Basic Attention Tokens as a way to reward us consumers for visiting participating content creators’ sites.

I don’t fully understand how Brave Rewards work, but I like this idea of enabling consumers to make micro-contributions to content creators, and help support them. It’s a bit like Recurring Payments on WordPress.com.

That said, I intend doing some more research. The model intrigues me!


If you’re interested in trying the Brave browser out, here are a couple things I’ve discovered so far that may help you make the move from Chrome, if you’re a Chrome user:

  • Brave is Chromium-based, so it actually looks and feels a lot like Chrome;
  • You can install Chrome extensions in Brave, just like you do with Chrome;
  • Instead of using Google sync to sync between Brave browsers on different browsers, Brave has its own sync tool. This may be appealing if you don’t want Google at the heart of your browsing experience.

I’ve enjoyed using Brave so far. I’m not switching away from Firefox just yet, but I’m using Brave as my preferred Chromium-based browser, and it’s working well for me.

In the meantime, here are a couple posts that I’m going to read for broader perspectives on Brave:

Featured image by Jack Sloop
Categories
Applications Coding Tutorials

The missing piece in my Python scripts

My quest to automate parts of my workflows usually involves writing Python scripts to streamline some of my tasks as a Happiness Engineer.

One output has confused me for far longer than it should have, and I was shown the light today (in the form of a pretty simple solution).

My dilemma

Many of my scripts generate template documents. These include meeting agendas, hangout notes, and team reports. These documents include a couple components that I’ve largely automated using Python, such as –

  • Calculating dates and times in reports (sometimes including timezone conversions);
  • Taking inputs I provide in response to command line prompts, running calculations, and adding those to fields in my reports; and so on.

Many of my documents have a static list of team members that I ping much like Twitter mentions when I publish them as posts on internal blogs (we use internal blogs quite a lot, as you can imagine). Those lists each need to be updated manually every time there’s a change in the team composition, in each of the documents the list appears in.

Although the team composition doesn’t change frequently, I often find myself re-using a script for a team report, or hangout agenda, for example, in another group I work with. This means another set of documents where I need to manually create a list of people, and maintain that.

An example could be something like this:

Pinging: @john-doe, @maryjacobs, @davesmith, @janestuart, @tomwright, @steverobinson

The solution

Currently, the first part of generating this sort of list of people is creating a .csv file that looks something like this:

first_name,last_name,username
John,Doe,john-doe
Mary,Smith-Robinson,maryjacobs
Dave,Smith,davesmith
Jane,Stuart,janestuart
Tom,Wright,tomwright
Steve,Robinson,steverobinson

I was planning on using Python Classes to do this, but quickly realised that I don’t understand Classes nearly well enough to using this feature for this aspect of my documents.

I realised that there’s actually a simpler solution using .csv files and the csv module available in Python instead, after watching Corey Schafer‘s tutorial on this, here:

As an aside, Schafer’s tutorials are wonderful!

I was able to borrow from Schafer’s solutions to write a script that produced a list that looks something like this:

Pinging: ['@john-doe', '@maryjacobs', '@davesmith', '@janestuart', '@tomwright', '@steverobinson']

My script looked like this:

import csv

with open('people.csv', 'r') as csv_file:
    csv_reader = csv.DictReader(csv_file)

    members = []

    for line in csv_reader:
        wpuser = f"@{line['wp_user']}"
        members.append(wpuser)

print(f'Pinging: {members}')

I couldn’t work out how to just generate a list of usernames separated by spaces. I ran into a similar issue with other scripts where I similarly loop over a list of items to produce some sort of list-generated output.

In other words, I couldn’t figure out how to output the list of usernames without the []' characters you see in my initial output.

So, I asked for help on reddit where JohnnyJordaan pointed me to this StackOverflow post that includes a couple solutions to a similar question. I had searched for a solution to my challenge, but didn’t come across this answer (or anything like it).

Clearly, I need to work on my Googling skills when it comes to finding solutions to my coding challenges.

Anyway, the solution that JohnnyJordaan suggested is pretty simple. Instead of using something like print(f'Pinging: {members}'), I could rather join the items in the list with a statement like this:

print(f'Pinging: {", ".join(members)}')

As I suspected, the solution is pretty simple. It just eluded me, completely. So thank you to JohnnyJordaan for the pointer!

I also like the * that came up in one of the StackOverflow solutions, but it doesn’t work with the f strings that I tend to use. Still, there are other ways to use them. Trey Hunner has an interesting post about these operators here (if you’re interested).

Categories
Applications

You don’t need Facebook News to keep up with news

Facebook News (or, rather, a Facebook News tab), is rolling out in the USA, and there are valid concerns about this already, for various reasons.

Whether you’re in the USA, or not, you don’t need (and may not want to rely on) Facebook News to keep up with the news. Instead, there is a tried, tested, and widely available alternative that you can configure to suit your preferences right now: feed readers.

Advantages to using a feed reader

Feed readers have been around for decades, and use RSS or XML feeds that most news sites (and virtually all blogs) publish to syndicate their content. They aren’t exactly the Hot New ThingTM these days, but they’re still going strong. They also have a few advantages over options like Facebook News:

  • You have a wealth of choice when it comes to selecting your feed reader;
  • You can choose which sources to follow, and you’ll receive all the updates from all of your sources, pretty much as they publish them without relying on an algorithm to share the updates in your feed;
  • If you don’t like using your current feed reader, you can usually export your feeds, and move to a new feed reader.

Feed reader vs feed aggregator

When it comes to choosing a feed reader, you’ll want to make two decisions: which feed aggregator you want to use, and which feed reader you wan to use to read your feeds. Some feed readers are standalone feed aggregators, and you can use them to subscribe to your feeds on your local device.

Most feed reader apps (like the ones I mention below) will do this.

The real magic is when you have a feed aggregator that syncs between your feed reader apps. They’ll all enable you to subscribe to your preferred feeds. All you’ll want to decide is which one to use. There are a couple services to consider:

  • Feedly – I consider Feedly to be the spiritual successor to Google Reader. It’s a web-based service that has both Feedly apps for iOS and Android, and you can also use a variety of 3rd party feed readers to subscribe to your Feedly feeds;
  • Feedbin – Feedbin is similar to Feedly in that it’s a feed aggregator, and integrates with a variety of 3rd party apps on multiple platforms; and
  • Inoreader – This is another popular service that has mobile apps for iOS, Android, and Windows Phone.

Feed reader and service recommendations

Here are a few great feed reader options to consider:

  • NetNewsWire – This mainstay from a decade or so ago is back, and is being actively developed as an open source feed reader for macOS. It’s contributors are adding more and more integrations and functionality at a rapid pace;
  • Reeder – Reeder is a paid macOS app that I’ve been using for years. It’s packed with functionality, including a decent Pocket reader;
  • FeedReader – If you’re a Linux user, this nicely designed app is a good option to consider. It seems to have borrowed it’s design from a macOS app I like, Reeder, and integrates with services like Feedly to give you a desktop option for your Feedly feeds;
  • WordPress.com Reader – If you’re a WordPress.com user, you can also use the included Reader as a feed reader;
  • Nuzzel – If you prefer to receive your news updates on Twitter (Twitter is pretty well suited for this), then Nuzzel offers a great way to collate news updates, especially when you use it in conjunction with curated Twitter lists that you populate with your preferred news sources; and
  • Thunderbird – You may remember Thunderbird as Mozilla’s email app. It’s still being developed, and includes a feed reader too. Thunderbird is free, cross-platform, and open source, so it’s a great option too.

When it comes to keeping up to date with news, and the sites you’re interested in, feed readers remain a terrific way to do it. There are many options available when it comes to both aggregators, and feed readers. Make your own choices, and subscribe to the content that matters most to you.

Featured image by Roman Kraft
Categories
Applications Coding Design

Two more Firefox Dev Tools tips for inactive CSS and tracking changes you make

If you spend a fair amount of your time in your browser’s page inspector examining and tweaking CSS, then you’ll probably find these two sets of features in the Firefox Page Inspector to be really helpful.

Track changes you make

Firefox Developer Tools offers a great way to track CSS changes we make while testing CSS solutions for users. Here’s a terrific video that explains how to use this awesome tool:

You can also find information about this in the MDN documentation, here.

Identify and understand inactive CSS

I came across another useful feature of the Firefox Page Inspector. From Firefox 70 (launched in the last few days), you can now see not only which CSS code is inactive, but also why 😲. Here’s an example:

I haven’t encountered this in practice just yet, but I can already see the explanations to be enormously useful. The links in the pop-ups will take you to the excellent MDN web docs for more information.

You may also want to watch this video explanation too:

Both of these sets of features are really useful!

Categories
Applications Coding Design

The Chrome browser inspector has a very cool feature

I primarily use Firefox Developer Edition as my day to day browser. I use the excellent Firefox page inspector several times a day to troubleshoot issues for our customers, and write CSS for a variety of tweaks on sites that I use.

As much as I enjoy using the Firefox browser inspector, I noticed a feature in the Chrome Dev Tools that I really like, and would love to see introduced to Firefox. It’s bit like a heads-up display that’s very helpful for seeing an element’s styles at a glance.

If I select an element in Firefox, I see fairly basic information about the element such as the element’s dimensions, and the type of element it is, like this:

Selecting an element in the Firefox page inspector

On the other hand, when I select the same element using the Chrome browser inspector, I see more information about the element, like this:

Selecting an element with the Chrome page inspector

Chrome provides not only information about the image’s dimensions, and the type of element it is, but also other useful information such as the font color, style, and margins (in this case).

Even though I can see all the details of the element in each browser’s inspector panel, this extra information when I select an element is a really nice touch.

unsplash-logoFeatured image by Abby Anaday
Categories
Applications Coding Entertainment Semantic Web

A curious sequence of events with Google and its YouTube recommendations

Well spotted there, Google! 🔭

I noticed a curious sequence of events this morning. I responded to a tweet about Donald Trump’s latest tweet where he referred to his “great and unmatched wisdom” using the Twitter app on my Android phone –

I then turned to our Android TV box where we were watching YouTube videos in the YouTube app, and I saw a recommendation for this Late Late Show video about Trump’s tweets:

That’s some pretty snappy algorithmic matching there, Google! 🤔

unsplash-logoCover image by Scott Webb
Categories
Applications Coding Devices

Giving a 2011 MacBook Air new life with Linux

I bought my wife a 11″ MacBook Air in 2011. It’s a Intel® Core™ i7-2677M CPU @ 1.80GHz (four core) laptop with 4GB of RAM. Over time the battery became less effective, and started to swell. We eventually removed it early last year, before it burst.

That left my wife with her MacBook Air that she had to use when connected to main power. It had also become pretty sluggish between macOS updates, and general cruft accumulation so it took forever for the device to boot up, and perform simple tasks.

My wife recently left her job, and we bought her (formerly) work Lenovo laptop for her to use as a personal machine. This left her MacBook Air gathering dust in a corner of the apartment.

An available option

I’d wanted a personal laptop for my non-Automattic projects, and was building up the courage to buy a new machine that I’d install Linux on. I decided to see if my wife’s laptop would suffice, instead.

I first reset the device, and poked around a bit in macOS. The laptop is past the support cut-off for the current macOS version, so it was running High Sierra (I think). It worked ok, but it felt pretty slow.

Setting it up

I’ve also wanted a Linux laptop to geek out on, so I took a leap, and wiped the drive completely (I was actually planning to configure dual boot, but couldn’t work this out), and installed Pop!_OS by System76 on it.

I installed a couple of my preferred apps such as Sublime Text, Sublime Merge, Dropbox, and so on. I also switched my shell over to ZSH (with Oh My ZSH), installed Conda as my main Python distro/option, and even figured out how to run Jupyter Lab on the laptop.

Of course I also installed the WordPress.com app for Linux testing too.

The laptop still seemed a bit sluggish initially, and it looked like all the processors were maxing out. I also couldn’t work out how to make the dock appear in a more convenient way, and how to add other bits and pieces to my desktop to improve my experience.

I then switched the desktop environment to the MATE desktop, and it seemed to help. For one thing, MATE is better suited to older hardware, and it has a bunch of indicators and widgets that you can customise. I liked it, but I still preferred the overall aesthetic of Pop!_OS.

I also realised that the reason why the laptop was so sluggish was because Dropbox was being Dropbox when it started up. It eventually released its death grip on the processors, to a degree.

Getting used to a different environment

My one big adjustment has been moving from my glorious 15″ Macbook Pro screen where I spend most of my time, to a teeny 11″ screen. On the other hand, I do like the much smaller form factor for mobility.

The laptop is small enough that I may even be willing to take this with me on work trips so I have a personal device for movies (assuming I can get them onto the device, legitimately), projects on longer flights, and so on.

The immediate challenge to all of that is that this machine doesn’t have a battery. I’ve found a solution for that, though. iFixit sells an after market battery for this model for about $75. That’s certainly cheaper than buying a new laptop (assuming it works).

Other than that, it’s also taken me a while to figure out how to do otherwise routine things in Linux. I’ve found ways to customise my experience of the desktop using things like GNOME Extensions, and other apps and utilities.

Mostly, though, I use Sublime Text for my writing and coding (I know VS Code is what all the cool kids are using, I prefer Sublime for now, and it loads really quickly), Firefox as my main browser on this laptop, and I have my terminal pretty much set up with my various extensions.

More of the similar for other home uses

My experience with this laptop has reminded me why I much prefer a Linux computer for home. Our daughter uses a really old desktop PC that’s running Ubuntu 19.04. The PC is a Core 2 Duo with 3 or 4GB of RAM.

When it comes time to replace that, I’ll probably give her one of the new Raspberry Pis with an external drive for storage. The current version is just incredible for what you’re paying. This review will give you a pretty good idea:

The new board comes with a four core AMD processor that, I think, is pretty comparable to the MacBook Air’s 2011 processor, up to 4GB of RAM, and runs on USB-C power. The 4GB model costs around $50 to $60, and the main challenge is actually getting your hands on one.

A Raspberry Pi would probably be a decent upgrade on what she has at the moment, and she could continue doing everything she’s been doing (Minecraft, browsing the Web to school sites, general school research, Google Drive, YouTube, Spotify) just fine.

I’d be very tempted to get one for myself one day, if I could come up with a decent plan for how to travel with it, and use it productively on the road. The biggest challenge would be a screen of some kind, I imagine.

So far, I like this

So far, I really like what I have. I’d like to get some other apps going, such as AutoKey for text expansion, and Albert for easier app launches, web searches, and some of the tasks I use Alfred.app for on my work laptop.

For the time being, though, this Linux-driven MacBook Air is proving to be a pretty good choice.

Featured Image: Unleash Your Potential Robot by Kate Hazen at System76, licensed CC BY SA