Posts for: #Dev

Running MySQL in Docker

Let’s containerize a database!

I wanted a database in my local machine to try out some queries and thought about setting up a little test environment. I didn’t want to go through the process of installing MySQL so let’s make some Docker containers instead.

Docker, the very popular container virtualization solution written in Go. Used as the very building blocks for microservices since it works very well with Kubernetes. I need a small database and don’t care about data persistence for the environment so this is perfect for small POC’s or projects.

Read more

Clay Bang Physics Troubleshooting

Oh for the love of Clay-Bang Physics

When I initially thought of making the clays fly in my game, I thought of using lines with randomized curves and making the pigeons fly along the line.

Once I finally got to making it, Love2D has a very extensive physics engine which is a port of Box2D so I thought “What if we use physics instead?”

I believe that once humans have a complete understanding of physics, we can be the masters of our own universe. I also believe that with enough physics calculations, I can be the master of clay-bang’s universe. Maybe once I finish this game I’ll set my sights to dark matter research, but for now, I’ll master projectile motion.

Read more

Showcasing the alive_progress library

Sure you can trust a computer, but why do that when you have progress bars?

Have you ever ran a script that needs to do I/O on several hundred files? You want to know wether it’s gonna be done now or go grab a cup of coffee?

So what do you do? Make some print statements at the end of the loop with something like “I"M DONE WITH FILE X?” What is this, 2010?

Read more

Time to add buttons to Clay-Bang

It is time to add some menu functionality to Clay Bang. I had followed a previous tutorial creating some buttons and running them in main.lua

pretty meh

This is good, but I want these to be centered. These are my three buttons in menu.lua. They will help with state management too.

self.buttons = {
  {text = "Start Game", x = 100, y = 100, width = 200, height = 50, action = function() State = "play" end},
  {text = "Settings", x = 100, y = 200, width = 200, height = 50, action = function() State = "SettingsMenu" end},
  {text = "Quit", x = 100, y = 400, width = 200, height = 50, action = function() love.event.quit() end},
}

In games, you are able to resize your window to different resolutions. How am I supposed to click if I only have a 30x30 monitor?

Read more

Hugo Shortcodes Pt. 3

Finally, a shortcode worth making

I have returned with a shortcode that ended up being pretty handy for me.

When using links with Hugo in Markdown I can use [text to display](url) to display the links and it works. It’s clickable, it takes you to the site, nothing wrong with it.

Me being me of course, couldn’t overlook the simple thing that the URL’s don’t take you to another tab. What is this, the 90s?

Read more