Journal Entries By Tag: #code

(Page 1 of 2)

Assorted journal entries with the tag #code.


Site Update: Welcome to the Grid!

TL;DR — Some details around the recent addition of a scrolling background grid to the site.

👓 2 minutes

Recently, I decided to try my hand at some CSS shenanigans, and spent a few hours replacing this site’s long-serving background image with a scrolling grid background.

I’ve been obsessed with digital grids ever since I first saw the movie Tron (presumably during its initial HBO release, when I was around 6). Tron and Flynn were some of my first heroes (they fought for the users), and I remember being blown away not just by the movie, but by being able to play the same game they play in the movie via the incredible Tron arcade cabinet. I distinctly remember going to the Chuck E. Cheese’s near our house and playing it, complete with the special blue joystick, and just like the movie, it was amazing. And it was all grids.

Tron Arcade Machine by Darth-Wiki-Man, used under CC-BY-SA
Lightcycle game, screenshot from Tron by Bally Midway

So that’s the “why”, as for the “how”…

The capabilities of #web rendering engines (AKA #browsers) have improved immensely over the last few years, particularly in the area of CSS effects. A link to a link to a link lead me to a couple of stack exchange questions and a collection of fantastic synthwave-inspired CSS effects. The next thing I know, I’ve replaced the site’s static background image with a scrolling one.

Except… I know that not everyone likes moving background effects, so the only responsible way to add an effect like that is with a toggle that allows the site visitor to turn it on and off at will. And the only responsible way to add an interactive toggle like that is via progressive enhancement: visitors without JS enabled (or those whose browsers don’t support <script type="modules">) will get just a static background grid, but those who do have JS get both the scrolling grid AND the toggle, tying the presence of the feature to the ability to disable it.

If you want to know more specifics, check out the commit on my self-hosted git server, in particular the changes to the scripts.js and styles.css files.

Because I, too, fight for the users.


Update: 2024-04-27

Since posting this, I’ve come to realize that the CSS-based grid solution I described above had some problems - most notably, the scrolling-performance hit, particularly on long pages. The simple presence of the affect was causing clipping issues and serious scroll-lag all over the site (really, any page longer than one vertical screen). Plus, the animations themselves had a tendency to get super-janky the longer they went.

Not as “user”-empowering as I’d hoped. 😦

In the end, I wound up trading out my pure CSS solution for an implementation that uses a tiny SVG file, as it is much more performant, while still allowing for color customization (I wonder why… 🤔). It’s a little bit “flashy”, but it’s still a decided improvement.


The Mythic Wars Have Begun!

TL;DR — My new card game has been published, so I wrote a card database for it.

👓 2 minutes

TL;DR - I made a game and got it published, so I made an app to help people play the game, and published that, too.

ICYMI, the card game I designed and ran a Kickstarter for was finally published a few months ago.

<gratuitous-plug> It’s called Mythic Wars: Clash of the Gods, and it’s available now at many fine gaming stores, or directly from either the Excalibre Games website or Amazon! </gratuitous-plug>

I had alot of fun designing and playtesting the game, and I’m quite pleased with the finished product. While I admit that I found the entire Kickstarting and publishing process to be somewhat less fun (and quite eye-opening), overall, the fact that I can now hold my game in my hands (and see it for sale at my friendly local game store) makes me enormously happy.

My game, on a shelf, AT A STORE!

Since I am a code monkey by trade (and a web developer by choice), I wanted to complement the game’s publication with the release of a simple, searchable database of all of the cards available for it. Taking inspiration from the Gatherer, the official database for Magic: the Gathering cards (the best example of such an application that I’m aware of), I mocked up something over the course of weekend, tweaked it over the course of a couple more weekends, and soon, The Codex Mythica was born.

It’s my first publicly-available Node / Express application, so the code’s kinda ugly, but I think it has some neat features, like a responsive layout designed to work well on different screens and devices, and a category-based searching / filtering system for sorting and selecting cards (along with the obligatory word search functionality). Plus, each card has links to both its art and to the Wikipedia entry for the its subject (or the Lovecraft wiki entry, in the case of some of the Outer Gods and their minions).

It also (finally) gave me an excuse to share something on GitHub! You can find it at https://github.com/ItsEricWoodward/codex-mythica

<gratuitous-plug> So, if you like games about gatherings of mages, ascended beings, or worlds where war is crafted, check out Mythic Wars: Clash of the Gods, available now at many fine gaming stores, or directly from either the Excalibre Games website or Amazon! </gratuitous-plug>

(Sorry, I’m contractually obligated to get in one more of those.)

Anyways, if you have any suggestions for The Codex Mythica, feel free to open an issue on GitHub or drop me a line (I can’t guarantee I’ll implement it, but I always appreciate the suggestions).


Fatigue and Mastery

👓 less than 1 minute

Tero Parviainen has a nice piece about Overcoming Javascript Framework Fatigue, but don’t let the title fool you - much of the advice can be applied those who work (and live) in most any rapidly-evolving field. Plus, it contains one of the best quotes from Rich Hickey (the creator of Clojure) about what skills a developer really needs to have (and those skills have nothing to do with preferred language or framework):

Programming mastery has little to do with languages, paradigms, platforms, building blocks, open source, conferences etc. These things change all the time and are not fundamental. Knowledge acquisition skills allow you to grok them as needed. I’d take a developer (or even non-developer!) with deep knowledge acquisition and problem solving skills over a programmer with a smorgasbord of shallow experiences any day.

Via JavaScript Weekly


Smartphone Cryptogeddon

👓 2 minutes

After yesterday’s Senate committee hearing on encryption, wherein both FBI Director James Comey and New York County District Attorney Cyrus Vance Jr. made some pretty nasty comments about strong encryption on smartphones and the apocolyptic-problems it could bring, I thought it might be a good idea to remind everyone of what Representative Ted Lieu of California said back in April about why some users wanted smartphone encryption in the first place:

Why do you think Apple and Google are doing this? It’s because the public is demanding it. People like me: privacy advocates. A public does not want an out-of-control surveillance state. It is the public that is asking for this. Apple and Google didn’t do this because they thought they would make less money. This is a private sector response to government overreach.

[T]o me it’s very simple to draw a privacy balance when it comes to law enforcement and privacy: just follow the damn Constitution.

And because the NSA didn’t do that and other law enforcement agencies didn’t do that, you’re seeing a vast public reaction to this. Because the NSA, your colleagues, have essentially violated the Fourth Amendment rights of every American citizen for years by seizing all of our phone records, by collecting our Internet traffic, that is now spilling over to other aspects of law enforcement. And if you want to get this fixed, I suggest you write to NSA: the FBI should tell the NSA, stop violating our rights. And then maybe you might have much more of the public on the side of supporting what law enforcement is asking for.

Then let me just conclude by saying I do agree with law enforcement that we live in a dangerous world. And that’s why our founders put in the Constitution of the United States—that’s why they put in the Fourth Amendment. Because they understand that an Orwellian overreaching federal government is one of the most dangerous things that this world can have.

It might be worth point out that Rep. Lieu is one of four House members with computer science degrees, is a Lieutenant Colonel in the United States Air Force Reserves, and served for four years as a member of the Judge Advocate General’s Corps, making him (IMHO) someone knowledgeable in this area.

And it just so happens that fourteen of the world’s top computer security experts agree with him, but who’s counting.


Two Hard Things

👓 less than 1 minute

Came across this little ditty today, via Martin Fowler:

There are only two hard things in Computer Science: cache invalidation and naming things.

– Phil Karlton

Personally, though, I prefer the corollary:

There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors.

Too true.