Developer Journal, International Day of Charity
Today observes the International Day of Charity, trying to highlight platforms for charity, philanthropy, and volunteering. Charity never works as a viable replacement for government services, as we see time and again. But still, it does do some necessary good, in an economy where those in power frown on public services.
Really, though, tax wealthy people, and stop giving them ways to dodge taxes. Use that money to help everyone in the community. It would look almost exactly like charity, except without the unaccountable billionaires deciding who deserves to live and die, you know.
Does working on Free Software sometimes feel like the same problem? Absolutely. And yet, I enjoy the tinkering, soâŚ
G.L.O.B.E. Archive
GitHub - jcolag/g-l-o-b-e-archive
After creating the repository last week, I moved my archives into it, and somehow thought that would take care of what I needed.
However, I outsmarted myself.
When I generated the daily files, I somehow imagined that they would always sit on my server with the same structure, and so the CSS and JavaScript references all had absolute paths, so I needed to update those. In case anybody needs to do something like this in the future, one straightforward approach involves the sed
(âstream editorâ) utility.
sed --in-place=.bak 's/\/globe\//..\//g' */index.html
While ugly, this takes the index.html
file in each sub-folder, then replaces every time it sees the old absolute path /globe/
with a new relative path that references the parent ../
. The --in-place
parameter says to modify the target files, instead of reporting the results. By giving the parameter an argument (.bak
), it saves the original file, just in case I fouled something up; once I confirmed that I did my work correctly, I delete the originals.
Finally, I added the background texture that I use for a lot of my personal work.
After changing the repositoryâs configuration, you can now browse and play the archived games.
Iungimoji Archive
GitHub - jcolag/iungimoji-archive
For this new repository, I followed the same process here as I did for the G.L.O.B.E. Archive, above, since the concepts overlap significantly. However, I also streamlined the process slightly.
Mostly for accountability, I still separated the big steps of uploading the archived games and changing the URLs from absolute paths to relative paths. After all, if something went wrong in that latter step, I wanted to have the ability to back out the change and try again. Without separating them, Iâd need to undo the changeâintroducing the risk of incorrectly undoing itâand then work from that unstable point.
However, while I updated URLs, I also slipped in the background texture, since that didnât seem to carry much risk.
And again, after changing the repositoryâs configuration, you can now browse and play the archived games.
What about Nonograms?
Oh, I feel like I should mention that, while I seriously considered doing so, I will not replicate the same process here for the Daily Nonogram archives. Even though they take up an order of magnitude or two more space than archives for the other two games use, I still need to generate the files on the server.
Well, yes, I could use fetch()
to call up the âRandomâ page Wikimedia Commons, parse it as I currently do on generation, then request the linked URL, in theory. But doing that (a) makes the player wait for the game on every run, and (b) increases the gameâs load on the Wikimedia Foundation servers from only me overnight, to every time a player visits the game. In other words, no, I wonât do that.
And because I wonât do that, I would need to update the archive repository every night with a script. And while that doesnât sound so bad, it means that I would need to have the repository cloned on my server, which doesnât actually keep the storage off the server at all, defeating the primary purpose of the exercise.
I may try to work out a compromise, at some point, such as updating the (as-yet hypothetical) repository on a monthly basis, or something similar.
G.L.O.B.E.
Now that I had the archived G.L.O.B.E. games off my server, it seemed natural to update the main gameâs page to point to the archive.
Here, I stuffed a straightforward message into an HTML footer
element. And while it seems entirely reasonable to expect footer
elements to act like a page footers, they do not. Therefore, they require some quick CSS.
footer {
bottom: 0;
position: absolute;
width: 99%;
}
For some reason, setting the width
to 100% overflowed the window, so I backed down the number. I suppose that I probably should have used a vw
measurement, though, regardless. Maybe Iâll experiment and update it, someday.
Incidentally, this reveals a mildly off-putting issue with treating these games as HTML and JavaScript applications, rather than generated pages: The browser only allows the fetch()
methodâthat the games use to load initial data onlyâto work when it loads the page from a server. When running locally, it (probably rightly) declares the method a security risk and shuts it down. That makes it incrementally more irritating to test changes.
Library Updates
Rather than add a footer
link to the Iungimoji archive, I needed to bump the version of a library for Dash.
Next
Most likely, the early week may go to (finally) adding configuration panels to G.L.O.B.E. and Iungimoji. I suspect that players might appreciate the possibility of playing more than once per day, updating the seed.
I may instead spend this week creating issues on repositories, again, to make sure that I donât forget about something that I want to get done.
It also wouldnât surprise me to discover that I have some changes that I forgot to commit.
Credits: The header image is Jewish cemetery in Otwock (Karczew-Anielin) by Nikodem Nijaki, made available under the terms of the Creative Commons Attribution Share-Alike 3.0 Unported license.
By commenting, you agree to follow the blog's Code of Conduct and that your comment is released under the same license as the rest of the blog.
Tags: programming project devjournal