Sharkham Codes


A blog for my coding journey

Dealing with overlapping reducers in Redux

My final project for Flatiron got a lot more complicated than I was expecting it to with reducers, and there were many little finnicky things here that tripped me up, even into the last hours of coding! This made me think it might be a good thing to write a blog about.


Dragging images with mousemove in JavaScript

After reaching a certain point in learning JavaScript, I knew immediately what kind of web app I wanted to build with it when it came time to do a project. How much control JavaScript gives you over your front end seemed like a perfect fit for making another Pokémon website (no one can say I don’t have hobbies!), this one with Pokémon sprites sized to how tall they would actually be relative to their trainers. After getting this set up, the thing I wanted most to do next was be able to drag them around so a user could create images of their trainer “posing” with their Pokémon.


Creating two resources 'at once' in Rails

For my Rails project for Flatiron, the thing that stumped me for the longest time was my models. One of the requirements was using a has-many-through relationship, and not only that, the join table had to have a user-submitted attribute on it. It couldn’t be purely a join table, only used in the back end to hook up two models and not showing up in the actual front end of the app in any way.


Making exceptions to ActiveRecord’s auto-pluralization

For my first web app using Sinatra and ActiveRecord, I decided to make a simple Pokémon manager. Make an account through the site, enter the Pokémon’s species, an optional nickname field, save it, view other user’s Pokémon… et cetera. Basic functionality. It sounded simple, but when I started to actually build it out, I ran into problems.


Scraping a complicated website for my CLI application

When it came time to make my first application using Ruby, I knew pretty quickly what I wanted to do.