I haven’t blogged in a while, but last night was an eventful night and I just had to share it. Enjoy!


It was the final evening of my off-hours L1 support rotation. As off-hours L1, I’m the first person to be alerted whenever an urgent P1 support ticket comes in outside of business hours. I’ve never gotten a support call in my previous rotations, so I was hoping I would end this rotation call-free as well. That was not meant to be, apparently.

I got a call from a number I didn’t recognize, so I did what I usually do with unknown numbers and didn’t answer it. But I decided to check the support queue anyway just in case and it turned out it was our on-call system calling me from a number I didn’t have saved. So I found the credentials to our response system and tried to log in, but the credentials didn’t work. I called the backup and he told me to try the password again. It worked now; I guess I picked up some extra characters when I was copying and pasting it the first time. It turns out the issue was in fact not a P1, and the support manager had already bumped it down to a P2 and responded to the issue to that effect. P2 tickets are handled the morning of the next business day and require no further action until then, so that was that.

Later, I was cooking dinner. I was roasting some vegetables in my toaster oven air fryer and started heating a wok on the stove on medium-high to cook some meat. I got a second call from the on-call system (which I now recognized because I saved the system’s vCard), so I went to go check it out. I’m still inexperienced at responding to off-hours support requests, so it took me a bit to figure out if it was actually a P1, but no, it was another P2. I wrote up a response similar to what the support manager responded with in the last one. Shortly after, I heard the smoke detector go off—I realize that I hadn’t flipped the vegetables, so they were probably burning! I promptly snoozed the smoke detector, unplugged the toaster oven, opened the windows, turned on all the exhaust fans, and fanned the smoke away from the smoke detector with a flattened cardboard box.

Then I noticed the stove element was glowing red: I left the stove on, too! I quickly turned off the element. The surface of the wok was dry as the heat burned off the seasoning. For reasons unknown to me, I thought it would be a good idea to add a bit of oil to the wok to cool it down and re-season it, or something. Of course it started smoking and lit up a flame. What did I expect? This isn’t my first time dealing with a grease fire, so I knew exactly what to do and kept myself collected. I found a lid and deprived it of oxygen. I watched as white smoke filled the wok under the glass lid. I resisted the temptation to lift the lid and went back to fanning the smoke out the window with the cardboard box.

After things had settled down and most of the smoke was gone, I finished cooking dinner. It was delicious.

Seared sirloin steak with Dijon-cornichon pan sauce and roasted potatoes, beets and carrots served with white rice, garnished with chervil.

v1.6.0 of the classic editor redirect script is out! I may be very inactive on WordPress these days, but I’m still committed to providing updates to these scripts when they break. If something’s broken, please create a GitHub issue or let me know in the comments. Thanks to musicdoc1 for reporting again this time!

As usual, your script should have updated itself, but if not, you can head over to Greasy Fork and install it manually.

This change also affects the bookmarklet, so if you use the bookmarklet method, please replace it with the new version (delete the old one and re-add the new one). You can get the updated code on the workarounds page.

For the technical details, you can go look at commit bfe80e4. In the last week or so, WordPress.com has started redirecting classic wp-admin editor URLs to the new editor. The classic-editor query parameter is needed to prevent the redirect. Adding the new parameter was very simple, but more code was needed to prevent an infinite redirect loop. In a later commit, the code has also been reformatted and lightly refactored to make it look nicer.

I fear that this change means the classic editor is on its last legs and we may see it disappear altogether in the next change, so we should enjoy the classic editor while it’s still here.

If you have any troubles, please leave a comment and I’ll be happy to help you troubleshoot. Happy blogging!

My stats sparkline script has been updated to v1.2.0! I noticed that I no longer had a sparkline because WordPress.com removed something the script was relying on, so I reworked it to rely on something else instead. I hope I didn’t break custom domains; let me know in the comments if I did.

If you have auto-update enabled for the script, you should receive the update soon. Otherwise, you can force an update check for the script in your extension or head over to Greasy Fork and install it manually.

For the technical folks out there, you can view the diff to see the actual changes. WordPress.com previously had a sliding drawer that came out when you clicked the “My Sites” button in the WP Admin Bar, but that no longer seems to exist. The script had been relying on the sparkline that was present in that drawer, but since it no longer exists, the script failed. I changed it to build the URL manually; thankfully I had an example saved.

Happy blogging!

Whenever I play Rock Paper Scissors for fun, I like to play a more strategic variant. I can’t have been the first one to have thought of this, but I can’t seem to find it described online, so allow me to describe it.

I developed this variant almost ten years ago as a simplification of Club Penguin’s Card-Jitsu game. Card-Jitsu required a special deck of cards; each card had a number, a colour, and an element. There were three elements—water, fire and snow—and each would “beat” another: water puts out fire, fire melts snow, and snow freezes water; yes, it was inspired by rock-paper-scissors. Each round, both players would choose a card to play, and the player whose card trumped the other card either by element or by number if the suit was the same would win the round. To win the game, one would have to have won three rounds with either a single element or one of each element (e.g. three waters, or a fire, water and snow), and each of the cards that are counted towards the win must be different colours.

The rules of Card-Jitsu showing what beats what and how to win

The basic rules of Card-Jitsu.

I simplified this to work with rock-paper-scissors. Each round is a regular throw of rock-paper-scissors and uses the same winning rules. Winning the game uses the three-of-one or one-of-each rule. It’s basically Card-Jitsu with the numbers and colours taken out, and the elements replaced with rock, paper and scissors.

See an example →

I just had a great idea: why not make a game like Notpron, but use Git as the medium instead?

I haven’t given this that much thought and I don’t have any ideas for puzzles yet, but here’s what I’m thinking:

  • The master branch would be the entry point for the whole puzzle. It will contain a README file with instructions on how to play and a pointer to the first level.
  • Each level will be represented by a branch whose name is of the form xxxxxxx/master, where xxxxxxx is a random string so that it is not obvious which level the branch is when looking at the output of git branch. This random string is the “level code” for the level.
  • If a level requires multiple branches, the name of each branch should be of the form xxxxxxx/yyyyyyy, where yyyyyyy is the name assigned to the branch, which can be anything.
  • The goal of each level is to obtain the level code for the next level.
  • Each level will make some use of Git’s functionality. File contents, file diffs, commits, commit messages, and even commit authors are all fair game. This is not an exhaustive list.
    • Ideally, this game should be playable through the GitHub website, or through a local clone of the repository obtained using git clone, so that unfortunately precludes the use of multiple remotes (to keep the puzzle self-contained) or hiding things in the .git directory. I wonder how GitHub deals with multiple roots…
  • Each level will have a README file that outlines the level’s puzzle. The first thing the player should do when reaching a new level is to look at the README.
  • All levels should branch from the initial commit, which should be empty. This allows flexibility in adding, removing, or replacing levels as needed.
    • Initially, I had the idea of having a game branch, where the commit of a level is the parent for the commit of the next level. I realized that this was not flexible enough if maintenance was required.
  • Like Notpron is to HTML and other technologies, this game should be an opportunity to learn about Git and to get familiar with it.

I don’t know what to call this game, nor do I have any concrete ideas for puzzles, but there’s the idea, and I think it has potential. If you have any suggestions, please leave a comment!

EDIT: The Cthulhu has been released!

v1.5.0 of the editor script is out! This version fixes an issue where the script does not redirect for private blogs and some Jetpack blogs. If you don’t have such a blog, then this update shouldn’t affect you. Thanks go to doc for reporting the issue.

As usual, your script should have updated itself, but if not, you can head over to Greasy Fork and install it manually.

This change also affects the bookmarklet, so if you use the bookmarklet method, please replace it with the new version (delete the old one and re-add the new one). You can get the updated code on the workarounds page.

For the technical details, you can go look at commit e41fe77. It seems that sometime in the last two years, WordPress.com changed the structure of the editor page, so the query used was incorrect. The change was simply changing the query selector to better target the element with the link.


As many of you know, Firefox 57 has been out for a couple of months now. In it, Mozilla dropped support for XUL add-ons, leading to many add-ons becoming incompatible with Firefox 57. Greasemonkey and Scriptish, two popular add-ons for Firefox that enable you to run user scripts like the editor redirect script, are both XUL add-ons and therefore incompatible with Firefox 57.

Some of you have brought your migration issues to my attention, so I figured I’d share the procedure here so the rest of you can spread the word. Apologies for taking so long to get this out.

Just to note, the scripts themselves don’t need any changes.

  1. Make sure Greasemonkey has been updated to the latest version. It should be at version 4 or higher.
  2. Reinstall the scripts you want (quick link to all my scripts).
  3. Try out the script. If it works, then stop here.
  4. Make sure that both Greasemonkey and the scripts are enabled. Restart your browser if you still have troubles.
  5. If Greasemonkey fails to work or is not complete enough for you, uninstall it and install your scripts with Tampermonkey or Violentmonkey instead.

Greasemonkey has worked when I tested it, but the reports I’ve heard say that it doesn’t, so you may want to consider skipping to the last step and using one of the alternatives.

I’ve also updated the relevant section in the workarounds page.

If you have any troubles, please leave a comment and I’ll be happy to help you troubleshoot.

I released v2.3.0 of the Classic Stats Redirect script on Sunday. Your copy should have automatically updated already. If you don’t already have the script or need to update manually, you can download your copy from Greasy Fork. Special thanks go to Dennis for helping me test out this version!

After the incident causing the release of v2.2.1 (I apparently neglected to announce v2.2.0 and v2.2.1; this release suppresses redirection for URLs containing from=wp-admin), I decided that I should write some automated tests to catch these kinds of errors before I end up releasing them. I will discuss the issue in the technical section that follows.

This update is purely a refactor and the behaviour should be the same. If anything has changed, please leave a comment or file an issue.

Technical details →

I’ve been playing mahjong since 2012. I love the game, but I didn’t own a set until last year when a friend gifted me one.

Before I had a set, I got a few friends together and taught them to play Classical Chinese mahjong through Julian Bradfield’s mahjong programs. It was great and we had a lot of fun playing. The program helped them learn by giving English tooltips on the tiles and disallowing illegal actions. When playing with real tiles, though, we don’t have that luxury.

I couldn’t find a good reference sheet online, so I made one. It’s inspired by the table on Wikipedia. I replaced some of the terms with ones that I usually use (e.g. “Arrows” was changed to “Dragons”) and replaced the images with Unicode characters. The three tile calls and their definitions are also included below the table.

Mahjong quick reference sheet

This reference sheet is intended for Chinese Classical mahjong, but since Chinese Classical is the most basic of versions, it can be adapted to teach the basics of any version.

This reference sheet is also available as a PDF, a 4-up PDF, and as an ODT.

How do you eat apples? Like many people, you probably eat around the sides, leaving that iconic core. That’s not how my friend eats apples. You’d see her with a whole apple and she’d bite into it in a way that looks kind of off. Look back in a few minutes and you’d see the apple gone; no core, nothing.

Apples

Apples

“What about the seeds?” I asked. “You don’t have to eat them if you don’t want to,” she replied. I passed it off as a weird way that she eats apples, but a couple of years later, I stumbled upon the method again on the Internet. I don’t know how I got there, but there it was. I was never really into eating whole apples when I was younger; my dad would always complain that I left too much on the core whenever I ate one, so I just stopped eating whole apples. I learned to eat apples the way my friend did after that, and now I’m more than happy to pick up a whole apple and eat it. I can’t go back to eating around the core anymore.


How to Eat an Apple Like a Boss | FOODBEAST LABS by Foodbeast [YouTube]

There’s a lesson to be learned in everything we do. What can we learn from eating apples?

Let’s find out! →

On April Fools’ Day this year, Reddit created /r/place and did a social experiment for 72 hours that involved a blank canvas. Members could colour one pixel of the canvas once every five minutes. By end of the experiment, multiple subreddits were working together to create a formidable work of art full of various cultural references. It’s amazing to see how it progressed and to see people on the Internet working together to create something, even with some conflict here and there. It also goes to show how even a small action like colouring a small pixel has a large impact if everyone does it.

Inspired by /r/place, I created potential-octo-potato. As I like to describe it, it’s like /r/place but with code on GitHub. The idea is that through very many minimal transformations, a working piece of software will be created. I have no idea what the program will do, what it’s supposed to be like, or even what language it will be written in; that’s all decided by you, the contributors. Even the name isn’t mine; it was the name suggested by GitHub when I created the repo. The only things I provide are the repo and the rules.

Like /r/place, there are rules in place to ensure that everyone gets a chance to contribute. The details are in the README, but in summary, each user is limited to one active pull request at any given time. Each pull request can only contain one commit, which must contain only a “minimal” change, whose definition is under the discretion of the project maintainers. The limit on the number of pull requests gives a temporal restriction, much like the five-minute restriction on /r/place; the “minimal” change requirement gives a scope restriction, much like the single pixel restriction on /r/place. I’m the only one who can approve pull requests right now, so I hope it won’t become too overwhelming.

A project like this requires lots of communication, so full use of GitHub’s issue tracker and wiki is highly recommended. If this project picks up, I might even consider creating an IRC channel.

Even if you can’t code, there are still ways to contribute. Want to see a feature in the project? Add an issue! Think something should be documented better? Write the documentation! Think this needs a logo? Go make one! You can also tell your friends about it and give the project more exposure.

I’m excited to see how this will turn out. Will it fail? Will it be unexpectedly popular? What will it do? That’s all up to you. So go ahead, make a pull request today and tell all your friends!

tpenguinltg/potential-octo-potato on GitHub.