Blog

Chaos at the Zoo - a badly written story

While I usually don’t post this kind of thing to my blog, this story I wrote for ELA is hilarious!

Chaos at the zoo, by Joshua Thayer
One day my friend and I went to the zoo. When we got there the parking lot was full of escaped lemurs with black cloaks fighting escaped chimpanzees with magical fire that shoots out of their tails. The lemurs were making advances towards the chimpanzees while we stared in shock--Then immediately turned around, put the pedal to the metal, and got the heck out of there. By the time we got back to my house, men in black suits, white shirts, and black ties were waiting outside. We got out of the car and walked over “May I ask why you’re here?” I ask, still half shocked from the zoo… incident, the agent mutters something under his breath like “Where is my Neuralyzer?”. He rummaged through his pockets for a moment before pulling out a strange looking device, he held it up then told us to look into it , the device flashed brightly then… Wait, we’re late! We need to get to the zoo!

Did you get the MIB reference?

Date of writing: 2025-5-14

Special edition post

There was a downtime window from approximately 21:50 EST to 22:15 EST 2025-5-14 as my website transitioned to use a git build system with Gitlab and GitKraken. Sorry for any inconvenience caused by this switchover, however this change will allow for much easier and quicker updates on my end.

Date of writing: 2025-5-14

sw.js

Today we're going to show you how to create a function full-site cache with a service worker(sw.js(The sw.js for this blog)); To accomplish this we’ll use a template I have created an show you how to set it up for your website, to show this I will be creating an implementation for tomxcd’s website, his website uses PHP and runs nginx/1.22.1. His website doesn’t have many pages yet, so this should be a relatively simple setup if we follow my template.
While you should overlook the entire code of everything you put on your website–and that stays true for this, the main part you need to worry about is:

const cacheName = 'my-page-cache-v001';//remember to increase every time you change a page
const staticAssets = [
'/',
'/url1',
'url2',
'url3'
];

First of all, as the comment says, every time you make changes to your website(Or more specifically any cached page) you need to increment the page cache version at the top.
Secondly the array directly below is what you need to change to configure the template to fit your website; In this example the root url and 3 example urls are included, to begin to figure out what pages you want to cache. In this case with derg.rest there is the following urls:
https://derg.rest/index.php or just root which is already included https://derg.rest/archive.php https://derg.rest/coming_soon.php
See? not many Urls, with that number of urls we can easily just change the config section of the service worker to:
const cacheName = 'my-page-cache-v001';//remember to increase every time you change a page
const staticAssets = [
'/',
'/index.php',
'/archive.php',
'/coming_soon.php'
];
See? Easy, now just save that customized service worker file as sw.js in your website's home directory, and include the following code on your website: <script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(registration => {
console.log('ServiceWorker registration successful');
})
.catch(err =>
{ console.log('ServiceWorker registration failed: ', err);
});
} //this is a critical SW that caches the page for when the internet fails
</script>

And voila! Cached website!

Date of writing: 2025-5-14

BrainFuck - Hello world

Today, we're going to write a basic "Hello, World!" program in Brainfuck. But first, let's talk about the 5 basic operations in Brainfuck:

"+" increases the value of the current cell. For example, if you want to change the value to 2 (which corresponds to the ASCII character "STX"), the correct code would be ++.

"-" is the opposite: it decreases the value of the current cell by one.

">" and "<" move the data pointer (or "cursor") one cell to the right (>) or one cell to the left (<), respectively.

"[" and "]" define a loop. Anything within the brackets will repeat as long as the current cell's value is not zero. For example, if you want to add 5 three times, you can use the code +++[>+++++<-] In this case, cell 0 is initialized to 3 and acts as a counter. The loop adds 5 to cell 1, then decrements the counter until it reaches zero.

"." prints the value of the current cell as an ASCII character. For instance, if the current cell contains the value 33 (which is ! in ASCII), you can use the Brainfuck code +++++++[>+++++<-]>--. to print !.

This has been a basic explainer of the functions we're going to be using today.

Now down to the Hello World, AKA hell to a normal human.
First we'll print "H", which after looking at a reference sheet is ASCII character 72. First we'll reach this number, which in this case we'll loop +10 7 times, then add two.
+++++++[>++++++++++<-]>++
Then we'll add a print to show the result:
+++++++[>++++++++++<-]>++.
And testing this on an online compiler, we can confirm it outputs "H".
Now it gets slightly easier, we now need to print "e"(ASCII 101). To Achieve this we'll add 29 to the existing value of 72, to do this we'll first add 30 with a loop of adding 5 six times, then subtracting one and using "." to output our second character:
<++++++[>+++++<-]>-.
After testing this correctly outputs "e", now so far our complete code is +++++++[>++++++++++<-]>++.<++++++[>+++++<-]>-.
Now we'll print the double 'l'(ASCII 108), to do this we'll simply add 7 without any loops and print twice.
+++++++..
Now we will append that to the end of the current code creating +++++++[>++++++++++<-]>++.<++++++[>+++++<-]>-.+++++++.., which correctly compiles to "Hell".
Now while saying hell in Brainfuck is a very good description of the language, that's reserved for Malbolge. Now let's continue with "o"(ASCII 111).
To achieve this code we'll simply add 3 to the current value and print with the code +++., this changes our complete code to +++++++[>++++++++++<-]>++.<++++++[>+++++<-]>-.+++++++..+++., which gives the result "Hello".
So, we have Hello, but we need world, though I wish I didn't have to, let's rush through the code for " World".
Next is a space (" ")(ASCII 32), now this is going to be a bit harder to jump from 111 to class="language-brainfuck"32, so we'll actually start using cell 2 and three, and starting from zero again with >++++++[>+++++<-]>++..
Now "w"(ASCII 119), now again, i'd be a jump to go from 32 to 119, so we're actually going back to using cell 1 again with <<++++++++.
Now "o", which we've used already so just reversing the last code with --------..
Next is "r"(ASCII 114), again very simply adding 3, so +++..
Again, "l", ASCII 108, so we'll just decrease 6 with ------..
Now, Finally... "d"(ASCII 100), this time we'll simply subtract 8 again with --------.

Yes! We now have a correctly written and compiled Hello world program in BrainFuck! The final code is 120 characters and is as follows:
+++++++[>++++++++++<-]>++.<++++++[>+++++<-]>-.+++++++..+++.>++++++[>+++++<-]>++.<<++++++++.--------.+++.------.--------.


Date of writing: 2025-5-12

Archival Blog posts

TECHGEEKUNITED, ©2025