In which I have a new job
October 6, 2022, 1:23 pm

I've started a new job. I'm working for PUBG. Well, actually I'm working for a company called Krafton. They're a parent company that purchased PUBG. But I don't get paid by Krafton. It's all very confusing. Working for a modern game company is almost certainly going to be a confusing labyrinth of company names and organizations. But whatever it is, I work there now, and it's cool.

I work with cool people. I feel like I know what I'm doing. And I definitely don't know what I'm doing. :D I mean I do. I know how to program. I know how to code. I know how to design. And I know how to work the game of thrones a bit. But there's so much minutia that is new and different at any new job you'll get to. I'm still figuring it all out.

We had a design layout issue yesterday, and between me and two other extremely smart frontend engineers, we couldn't come up with a "simple" solution to it.

The concept is this:
  • A list of circle icons.
  • When just enough icons for one row can be shown, show one row.
  • If it is necessary to show more rows, show them as alternating even and odd count rows.
  • Whenever possible avoid having a single hanging item in the last row.

It's that last item that really throws everything into issue. It changes this problem from one that's possible, to one that turned out to be very difficult / near impossible.

And this is when every engineer / designer has to be willing to make compromises. Either compromises on how much work you're willing to put in to solving a problem as an engineer, or how much outlier design goofs you're willing to allow in to a solution which allows a 95% success rate.

After sitting down and pushing some things around, a solution was come to, but it wasn't easy, small, or perfect.

See the Pen even odd grids by Hamilton (@bronkula)

on CodePen.

Ultimately I think it is, however, an elegant solution. It solves for most of the problem, while solving entirely the spirit of the design. Sometimes this solution results in hanging last rows. But that compromise is so that the design always tries to take up as much horizontal space as it can. When it comes to responsive designs you MUST be willing to compromise and figure out what you're willing to give up to reach as close to your goal as possible. Sometimes the math just DOES NOT allow what you envisioned.

I made a tutorial
September 20, 2022, 12:03 pm

I still have a youtube channel. I lost my ability to monetize it a couple years ago, because I rarely upload anything to it, and I have almost no traffic through it. But I do still every so often upload to it.

Toward the end of last month I started work on a javascript written gaming engine. And mid way through it, I thought I should catalog the most basic steps in a video tutorial.

It was a fun little diversion, and it helped cement a couple concepts in my own mind as I went along.

And then I think youtube somehow threw this into some search parameters, and the video got a tiny bit of traction. And now people are saying they want more. And ugh. Fine! I guess I can do a little more. But genuinely I'm still making this all up as I go along, and I'm not sure how correct I am. A lot of the concepts I'm learning at the exact same time and it feels weird to try to explain something to someone else that you don't fully understand yourself.

But I guess that's the life of a teacher. You know just enough to do, and therefore other people only truly want to know just that much as well.

I'm not sure where I want to go with this game engine tho. I've been telling people that I'm working on it. And I HAVE been working on it. But I don't really have a game in mind for it. Truly, I just kind of love making the engine. I like working on library code. I suppose I could go back over other game types and just run them out one at a time in this new engine concept.

In which I updated a bunch of old projects that none of you will see.
August 22, 2022, 2:37 am

So this weekend has been a bit of a whirlwind of coding.

Two weeks ago, I started watching a video on how to make a python game using a library called pygame. Creating a Stardew Valley inspired game in Python. It's a pretty decent 6 hour tutorial on some basics of game design. It's incomplete in terms of its game outcome, but it will get anyone interested in the topic pretty far into the start of some concepts.

The thing is, I don't really want to learn python. Not really. Not right now. I already know javascript. And the two languages aren't THAT divergent, so I thought I'd give a shot at converting his example into javascript.

The immediate problem I ran into is his use of the pygame library. Its documentation is... rough. But the thing is, I've made a lot of libraries in my time, including math, graphics, and querying concepts. I just needed to bring them all together, and sort of adapt any interesting pygame concepts I came across.

So I started into it. And after about a week, I was doing pretty well. And then on friday something terrible happened. Well this whole time I had been diving through old code, to see if any of my stuff I'd already written was compatible to be brought into this project. But then I started looking through old projects and applications on my server.

You guys, a few months ago I updated my php installation to php8. I don't regret this. But it broke like 10 of my websites immediately when I did it. After making sure all of the sites I could think of were fixed, I moved on. But this weekend I found more. And more.

I found old scripts like my file browser that weren't working. And then trying to fix that made me realize my php package manager wasn't working. Then I made myself a link page to some behind the scenes projects of mine and realized my sql manager wasn't working either. Then I noticed a bunch of my old AAU example files weren't working either. It was a mess.

Slowly but surely over the course of this weekend I've been not only fixing php8 bugs, but I've been adding to and completing a bunch of old projects. Hell, I'm writing this in my blog editor, and I've even started updating the css and layouts of that tool as well.

I'm writing some of the best code I've written in years. I'm way better at javascript and php now than I was even 6 years ago, and both languages have improved a ton on their own. For a few years I've had zero motivation to work on my own projects. Getting laid off put me down low for a bit, but I think I'm coming around the corner. Now my only enemy is sleep. And money, I suppose. I wish I could just keep going forever.

Is it bad to not update your blog?
December 30, 2021, 10:29 pm

What if it was extraordinary times? What about then? What if life went absolutely nuts all around you, and you just sort of forgot to update it? What then?

It's been a hot minute since I've put very much on this website. I need to redesign it. I need to rewrite some things (especially an image uploader), and I need to make more of an effort to keep my self honest about my projects by posting about them in public. Let's see... where was I?

This year has been a series of big changes. At the beginning of 2021 I was let go from my full time status at the Academy of Art and I got a job as a Senior Frontend Engineer at a company called IMVU. This job has been really fantastic. But it's the first fully remote job I've ever had. Working fully remote is not something I ever sought, and it's been both freeing and frustrating in a lot of ways. I like to be around people, and if I'm totally honest, when I'm stuck in a house, I find it hard to motivate myself.

I am still teaching at the Academy sometimes. I like it. Not sure how much longer I'll be able to continue, but I think for now if they keep inviting me back, I'll continue teaching a class.

I worked on a number of personal projects. I've been doing a lot of things with themoviedb api. Did a little project with a friend for figuring out which of your friends you're most compatible with, based on the movies you like. And I just pushed a big update to filmswith, a website for browsing movie data, and comparing people and movies together. I rebuilt that app from the bottom up in React, and I've learned so much during the process.

I'm not sure I'd call 2021 a success. When 2020 started, I thought it was going to be such a good year. I had so many plans. In some ways it was great for me. But 2021 just feels like a blur. I'm not sure what to expect in 2022. I just have no idea. But I think I'm going to try to work on more personal projects. Here's hoping I can stick to that. Someone keep me honest.

Icons and libraries
July 10, 2020, 3:15 pm

So I have a thing that I work on periodically. It's a library of javascript code that is... well more or less a jquery replacement. But it's something I wrote, and it's something that does what I want. And I made it to learn a lot, but also because it's small, and it's clean, and I like it. It doesn't really have a name, but it's part of my apptools collection on github, and it just got a new release.

I was working on another project, my icon library, and I started to convert it to something that uses my library, and it had ALL KINDS of problems when it came to querying on an svg element. Turns out I had to solve lots of problems, and I had to solve a number of them, and I had to set up an ampps server to get everything working right, and it was just a whole thing.

But I think I fixed a number of necessary issues with my library, and it's never felt better. Not just its use, but also my whole work process got streamlined a bit, and it felt really good.

... Maybe I'll update my website one of these days.

A bit of an overreaction
March 7, 2020, 2:15 pm

So I've been learning react recently. I've been getting pretty far into it. I'm pretty confident at this point that I understand the concepts, and I'm able to execute on React Hooks effectively.

I made a quick little demo example TicTacToe game, because one of my colleagues was doing a tutorial, and I wondered if I could write one from scratch. And the answer is, I COULD, but also I pulled a tiny bit of code from one of my old examples. But honestly I just pulled the win arrays, because my brain shut down, and I couldn't think of how to do them for a second.

So if you're interested, here's a quick React app of TicTacToe, and the Github repo to go along with it.

I'm enjoying React a lot these days, and I've started multiple projects in it. It's groovy, and I like the build processes.

Who was in that film with that other guy?
September 10, 2019, 8:42 am

A while ago I made a thing, but I never really released it, because it was never really done. It still isn't, really.

Sometimes when I'm in a bar, I want to know the name of an actor. I don't remember their name though. I don't remember the name of the movie they were in. But I do remember they were in another movie with another actor, and I remember that actor's name. Playing this game of musical chairs with names is something that can sometimes be frustrating when you don't remember anyone's names, but you remember their faces.

I also sometimes wish I knew all the movies that two actors have been in together. Or all the movies an actor and director have worked on with each other. Or perhaps all the actors that appear together in two movies.

I've always wanted an app that could cross reference these things, and honestly, I always wanted to make it myself. So I started work on it recently, using VueJS and The Movie DB. It was a lot of fun, but I wasn't really liking basic VueJS. So I'm working on remaking it in my own framework. But more on that later.

For now, you can find this tool at FilmsWith.com. Check it out, see if you can figure out how to use it... I often find that it's just nice to browse a site of faces.

Javascript continues, so I make silly things
February 16, 2019, 2:56 pm

I am continuing my own javascript education. I have begun documenting some instructions, which I will divulge soon, hopefully, but I've also begun redesigning some old examples that I made for students, in order to make them more accessible. One such example is from my app development class where students often want to add more interesting interactions to their projects. It's difficult to suggest things to them, especially since simply pointing them at HammerJs rarely results in them spending effort to fully understand that library, and instead just confuses them by making them search all over the internet for a simple solution to that toolset.

So here's one fairly simplistic example. Not only for my students, but of my current goals. This is an IOS style list item swiper. You've definitely seen these before.

See the Pen Vanilla Javascript IOS style list item slide reveal by Hamilton (@bronkula) on CodePen.

The content inside of the elements, and the look of them, is mostly up to the developer. This particular class, which can be found on github, has a number of options, including an onupdate method which will be sent the swiper object to give the developer freedom do do lots of things.

Many interesting layouts can be created and used, and I'm still currently working on some other options. If you'd like to mess with these examples, you can find them on my Codepen.

The Unit Circle
December 15, 2018, 5:14 pm

I got a little bit obsessed with trigonometry this last year, and over the last week, I really tried to understand as much of it as I can, and how it is used in Javascript. I made a thing. There was a Reddit post about a unit circle gif, and I said to myself. I can make that, but better and interactive. And so I tried to. Here is an embedded version of my Unit Circle.

This thing is a kind of big deal to me, because it represents a lot of big things. One thing is my general shift over the last year toward actually documenting the things I make. I've been working hard on a lot of projects, including my drawtools and apptools libraries. I've been learning a lot about the latest ECMAScript in order to push my own knowledge and really be able to make these tools be great and useful.

And I'm kind of really proud of myself. People look at my art and they either like it or they don't. But people see the things I code and it feels like they think "I wish I understood this" Because I must be so excited about it. And they aren't. My code is like a high schooler's poetry. No one cares. I'm writing a pity party right now. That's what this is. I'm having a party just for me, and the topic is poor me. But it's what I feel sometimes.

I just have to say for myself that I'm proud of me. And if you're proud of me, I hope that you'll share some of the dumb things that I make sometimes.

This is really just for me...
August 11, 2018, 12:21 pm

So you want to write in vanilla Javascript. But you've definitely noticed it's missing some shit. And if you haven't noticed, it's because you never really learned how to write jQuery.

One of the major reasons I will probably not give up jQuery any time soon, is because of event delegation. Event delegation is a great way to make event listeners that don't require an existing element yet. This lets us set up events for any element that MIGHT exist some time in the future.

Well here's a small function to add super basic event delegation for a space separated string of classes to your code setup.

function delegateEvent(delegate,event,target,callback){ var targets = target.split(" "); delegate.addEventListener(event, function (e) { targets.forEach(function(o){ if ( e.target.classList.contains(o) ) callback.apply(e.target,[e]); }); }, false); }

It's pretty simple. But it's a major relief to have this written out even for myself.

You could even take this one step further. You could add a delegate function to all object prototypes. This is technically a bad idea for big projects, but you shouldn't be writing very much code like this for that size of a project anyways. You should be using some framework or library.

Object.prototype.delegate = function(event,target,callback){ this.addEventListener(event, function (e) { var targets = document.querySelectorAll(target); [].forEach.call(targets,function(o){ if ( e.target == o ) callback.apply(e.target,[e]); }); }, false); }

This even gives us the ability to create query selectors instead of just class lists like the previous example.