TrickJarrett.com

Sunday, May 29th, 2022

« Previous Day Next Day »

HTML to Markdown

We're officially a Markdown blog! For those unfamiliar with Markdown, it's a 'markup language.' That is, like HTML, it defines how a document will look - using a very simple system. I'll dive into why I'm doing this later in the post. For you all, you should see (almost) no change on the blog, most everything I discuss here is relating to the backend management of it.

A few days ago, I quickly worked out the code which would take every entry in the blog and convert them from HTML to Markdown. I also took the opportunity to fix some content errors in the site; though it's not all fixed. Before running the conversion, I did a lot of testing to be confident it wouldn't screw up the database - but, having done that, I still took an export of the database as backup before running it. You can never be too careful when dealing with something that could potentially ruin your website.

This morning, after the entries in the database were converted, I switched my admin interface to a different editor which supports Markdown. I am currently going with Editor.md which looks to be a markdown editor made for the Chinese market. It's quite robust, though I have a few things I still need to figure out. Such as, when writing this post, I went to use a modal and the UI popped up in Chinese! Whoops. Thankfully it was a quick fix as they provide a bit of code which fully translates the UI into English.

Once the editor was in place, and I had confirmed all of my normal admin functionality worked, I then finished implementing the publishing which would turn the Markdown into HTML. Thankfully the Parsedown library for PHP is robust and simple. It only took a few lines of code to implement it.

That was it. Overall, very straight forward, and now my blog is future proofed. The future-proofing is one of the major upsides of using Markdown.

The editor I was using before was called Quill, and while it's a very powerful rich-text editor,the HTML it created was not perfect. This isn't a problem limited to Quill, many rich text editors struggle with this. I still remember the nightmare code that Microsoft Word would produce if you saved your document as an HTML file. So, with Quill, I was having to do code cleanups and figure out workarounds for some of its quirks.

Ultimately, this is not a huge thing. Many other blogs store their posts in HTML. I just like knowing it is in Markdown for flexibility. And, making Markdown the core structure of the backend enables me to potentially do some other things for inputting new entries. Dave Winer, the father of RSS, has a neat thing he put together where he can tweet a thread in markdown and his blog will pick it up and import it as an entry. I don't currently plan to do that with this blog, but it's an example of where making Markdown the editorial core enables some greater flexibility.

5/29/2022 8:03 am | | Tags: programming, html, markup, glowbug

Wordlebot

I'm still playing Wordle. This week NYT rolled out Wordle Bot which is a little script they run over your Wordle page and it evaluates and commentates on your word picks. It's interesting, not overly useful, but interesting.

One thing I found interesting is that it points out how many potential answers remain after each word you enter. I've never thought about my word choices from the "What eliminates the most possibilities?" angle. Probably because I'm not a computer. I don't look at the game and start listing possible answers. My heuristic for word choice is usually based around using the most common letters, namely vowels (and honestly, Wheel of Fortune's R S T L N E is a go-to for me.) But it is interesting to see how Wordlebot breaks down your guesses.

I still wish NYT would integrate your Wordle scores into your NYT account so I'd have portability of it and not be limited to doing it on my phone. Granted, I would do it there 90%+ of the time if I had the portability, but it would still be nice to be able to switch over and do it on the laptop sometimes.

Got today's Wordle in four by the way and Wordlebot was very impressed.

5/29/2022 8:17 am | | Tags: wordle, daily games

Eclipse & Terraforming Mars

Got to enjoy some quality boardgaming last night with friends. First was a game of Eclipse. Eclipse looks, at first glance, like a game about space combat. But in truth it is much more about exploration and resource management. I've played it a half dozen times now and I quite enjoy it. I didn't do to well yesterday, I ended up boxed in on the map, had some bad dice rolls, and really struggled economically. But, it was still a very good time.

After that, we kept with the space theme, and played Terraforming Mars. Another game I've played many times, I even have it on my phone. We played with a number of the expansions and it was a fantastic time. Again, I struggled economically due to some poor choices on my part. But I think I did alright, all things considered.

I was telling my friends last night, I still consider the lack of ability to get cards to be my biggest criticism of the game. They raised good counter points, and I'm perfectly willing to believe I'm wrong. But I can say confidently that for my enjoyment, if there was some standard action sort of way for me to draw a card and have a bit more agency over that, I'd be a happier player (and likely still loser.)

There are few ways I'd prefer to spend my Saturday afternoons than playing boardgames.

5/29/2022 8:25 am | | Tags: boardgames

AI Attempts Converting Python Code To C

This is an interesting idea. Just last week, when I was exploring Markdown stuff in preparation of working on the conversion for the blog, I came across a fantastic Markdown library from Stripe written for Nodejs. And I was bemoaning I didn't have access to it. A future where we have AI systems to do porting between platforms or systems is an exciting future.

5/29/2022 9:15 am | | Tags: programming, artificial intelligence, machine learning

How Soccer Succumbed to the Global Elite

Deep down, there’s something about sport that reveals people’s natural conservatism. The experience of living through the decline of great players and great teams brings an acute sense of the passing of time and of loss—something you don’t get so obviously with states or empires, which take longer to fall. This is why documentaries about Michael Jordan’s Chicago Bulls continue to be watched by millions, and why TikTok seems to constantly offer me clips of old English Premier League players reminiscing about the good old days. These are all reminders of a more innocent age in one’s own life.

5/29/2022 9:39 am | | Tags: soccer, oil, world politics, 1%

College commencement speech by Bill Watterson

Bill Watterson, for those of you who might not immediately recognize the name, is the genius behind Calvin & Hobbes. This speech is titled "Some Thoughts On The Real World By One Who Glimpsed It And Fled", and was delivered to Kenyon College (Watterson's alma mater) back in May 1990.

5/29/2022 9:59 am | | Tags: bill watterson, calvin and hobbes, commencement speech

The Flight Attendant

I finished season 2 of The Flight Attendant yesterday. Going into the series I had no real idea what it was about, I had heard something to do with the CIA - I think that was from a blurb on HBO Max. One day I put it on in the background and got sucked in.

It's not a John le Carre novel, but it does have intrigue. I figured out most of season 2 pretty early. But if you end up watching this for the spy/mystery, I think you'll be disappointed. It's much more about Cassie's (Kaley Cuoco) struggles with her alcoholism, mental health, dealing with trauma from an alcoholic father, as well as her own trauma caused on others.

Overall, the show is nothing mind blowing but I did find it interesting and a fine bit of media for when I'm working on other things and don't want to pay full attention. I give 3 out of 5 stars.

5/29/2022 10:10 am | | Tags: tv, streaming, hbo max

The Magic of Alleyways

Ever since ancient Uruk, the world’s first major city, founded around 4000 BC in what is now Iraq, alleys have served as a borderland between private and public life. Uruk’s covered lanes, no more than eight feet wide, offered respite from the sun when residents walked to the temple, as well as a space to escape from tiny windowless homes. A place to meet and make mischief, tucked away from the plazas where power and privilege reigned, these were sites where urban ideals collided with human desire.

That would never change. Even as the back alley shifted form and function, inspiring local variants in every urban culture—the “castra” alleyways in Roman fortress towns, the hutongs of Beijing, the terraced lanes of Istanbul with howling packs of dogs—it stayed the city’s unofficial social laboratory. The lower and middle classes of early modern Seoul defied a rigid caste system in narrow Pimagol: “Avoid-Horse-Streets” where nobles couldn’t ride. The alley coffeehouses of 17th century London fueled a newly democratic culture of ideas—a space, as poet and satirist Samuel Butler observed, where “gentleman, mechanic, lord and scoundrel mix, and are all of a piece.”

5/29/2022 10:46 am | | Tags: history, city life

The Science Is Clear: Gun Control Saves Lives - Scientific American

What research we have is clear and grim. For example, in 2017, guns overtook 60 years of cars as the biggest injury-based killer of children and young adults (ages one to 24) in the U.S. By 2020, about eight in every 100,000 people died of car crashes. About 10 in every 100,000 people died of gun injuries.

While cars have become increasingly safer (it’s one of the auto industry’s main talking points in marketing these days), the gun lobby has thwarted nearly all attempts to make it harder to fire a weapon. With federal protection against some lawsuits, the financial incentive of a giant tort payout to make guns safer is virtually nonexistent.

[...]

A study comparing gun deaths the U.S. to other high-income countries in Europe and Asia tells us that our homicide rate in teens and young adults is 49 times higher. Our firearm suicide rate is eight times higher. The U.S. has more guns than any of the countries in the comparison.

As we previously reported, in 2015, assaults with a firearm were 6.8 times more common in states that had the most guns, compared to the least. More than a dozen studies have revealed that if you had a gun at home, you were twice as likely to be killed as someone who didn’t. Research from the Harvard School of Public Health tells us that states with higher gun ownership levels have higher rates of homicide. Data even tells us that where gun shops or gun dealers open for business, killings go up. These are but a few of the studies that show the exact opposite of what progun politicians are saying. The science must not be ignored.

5/29/2022 11:00 am | | Tags: gun control, us politics, school shooting

5/29/2022 11:04 am | | Tags: weather, rain

It is honestly shocking to me how ESPN+ has almost no algorithm in its offering of sports to viewers. I have never, in any way, desired to watch golf, and yet I have to wade through their streaming of it to get to the sports that I actually want to watch.

5/29/2022 3:20 pm | | Tags: sports, streaming, espn
« Previous Day Next Day »