Music Gear Share

A gear sharing app built with AngularJS and Rails

MusicGearShare is a Craig’s List style application where users can sign up and share their music equipment with each other, including anything ranging from instruments, accessories, sound equipment, and more. After signing up, users can search gear thats available to rent and messages each other to coordinate sharing and renting.

Continue reading “Music Gear Share”

Rails Project Management AJAX Refactor

Now with 100% more AJAX

ajax
No, not that AJAX.

About one month ago, I finished version 1 of Rails Project Management, my first full scale web application, for my Flatiron School Ruby on Rails assessment. My next assessment was to refactor the program with Javascript and implement dynamic features only possible through JQuery and a JSON API. I decided to focus on refactoring some of the CRU functionality for Projects, Tasks, Comments, and Notes so they use AJAX instead of full page refreshes. This project was also a great learning experience for using HandlebarsJS, a Javascript templating tool. While the “remote: true” pattern would have been easier, the assessment required that we not use it.

In this post I’ll do a deep dive into how and why I refactored each feature.

Continue reading “Rails Project Management AJAX Refactor”

Rails Project Management

Rails Project Management, (or just RailsPM) is my first full scale web application, built from scratch for my Flatiron School Ruby on Rails assessment. As a former project manager, I thought it would be fun to build an app based on the knowledge I acquired at my previous job. While realistically I wouldn’t be able to currently build an application that could complete with robust software on the current market (like Teamwork, my favorite PM application), I had a lot of fun in the process. There were a number of challenges I faced along the way but I also learned a lot!

Continue reading “Rails Project Management”

Using Basic and Custom Rails Validations

Rails Validations

In Rails, validations are special method calls defined at the top of the model class. Validations protect your database by preventing model instances from being saved to the database if they contain invalid data. Rails uses ActiveRecord to execute these validations. Keep in mind that AR validations are not the same as database validations, which check for things such as string length, data type, etc.

In the following post I’m going to cover implementing both basic and custom Rails validations. I had a tough time figuring out how to make the custom validations work since there was a lack of detailed information about them.

Continue reading “Using Basic and Custom Rails Validations”

Sinatra Car Maintenance Tracker

The Sinatra Car Maintenance Tracker is my first real web application, utilizing the Sinatra framework, Rack, and Active Record. I went through a number of different ideas (exercise tracker, chess game tracker) and rebuilt my application several times before I finally settled on the car maintenance tracker. Basically, it allows a user to keep track of the maintenance records for their vehicle. As a car owner (1999 Honda Civic), I’ve never been good at tracking my maintenance (I’m one of those people who prefers to do the maintenance myself, instead of taking it to a mechanic).

Continue reading “Sinatra Car Maintenance Tracker”

Why I switched to Web Development

It wasn’t an easy decision to make. But I’ve never been happier. I decided to switch my career to Web Development for several reasons:

– I was experiencing a growing lack of fulfillment in my previous occupation, since I was in more of a managerial role and not as hands-on with production
– Web development is an in-demand skill
– It’s a well respected profession – web developer’s are like the tech industry’s rock stars! (okay, that might be an exaggeration)
– On a personal level, it’s important to understand the foundations of technology, which we interact with every day

Continue reading “Why I switched to Web Development”

Steam Upcoming Gem

The Project

I consider the Steam Upcoming gem to be my first legitimate project in Ruby – creating a Command Line Interface (CLI) gem from scratch! It was also my first opportunity to code an application using a Git and test driven workflow.

I decided to use Steam’s Upcoming Games page as the basis for my gem – the Steam Upcoming Gem, which scrapes that page for a list of upcoming games on the Steam platform and allows the user to drill down into more information about each game.

steam-upcoming-gem-terminal

 The Process

I started the process of building the Steam Upcoming Gem by analyzing what my requirements should be. The listed requirements were:

– Deliverable must be packaged as a gem
– Deliverable must provide a CLI on gem installation 
– The CLI gem must provide data from an external source, such as via scraping or an API
– Data provided must go at least a level deep, generally by showing the user a list of available data and then being able to drill down into a specific item

I initially considered using an API but decided to gather the information via scraping as I am currently more experienced with that (though I love a good challenge!). I then had to decide what I was going to build. I knew I wanted to do something different, interesting, and challenging.

I settled on scraping information from Steam, a popular online platform with a massive online catalog of games for purchasing, playing, and sharing.  While not an avid gamer anymore, I do enjoy playing video games when I have the time and figured this would be a fun project to work on that might be useful as well (my wallet might disagree).

The next step was to define what information the gem would scrape and what functionality it would have. I settled on the following information to start, though I did want to do more:

– Game name
– Release date
– Platform (Windows, Mac, Steamily, Linux , etc)
–  Tags
– About – description
– Details – other info about the game (single player, multi player, VR support, etc.)

After defining the information I wanted to capture, I started coding my classes, methods and tests.

Revisions

Once I had a basic CLI application working , I started to do some refactoring. One of the major issues I identified was the application load time – up to 15 seconds to load the results! The original code I wrote would scrape the index page, create the game objects and list, and would also create all the attributes for all the games before finally displaying the list. I realized this was terribly inefficient and decided to refactor my code so the gem would only create and display a game’s attributes when it was selected by the user. This greatly improved performance and decreased the load time from 15 seconds to about 1 – 2 seconds (depending on Internet connectivity speed).

I also added in some of the functionality I thought would be in version two – the ability for users to load additional pages of results and a page tracker so the user knows what page they’re on while sifting through the results. I also added error messages for users if their input is invalid.

Finishing Touches and Wrap Up

At the end of the project, I reviewed all my code again to add comments and simplify the code where necessary (eg removing unnecessary lines of code and any simple refactoring). I also used the Colorize Gem to add color to the gem and make it more visually interesting.
Check out the Steam Upcoming gem on Github and Ruby Gems.


 

Thoughts for version 2

  • Ability to sort the results by Release Date, Name, Lowest Price, Highest Price, and User Reviews.
  • Include the total number of upcoming games when the gem loads.
  • Refactor the “page” command so a user can type “page [page_number]” instead of the page command, then the number separately.

 

Suggestions for the Steam Upcoming Gem? Leave them in the comments or shoot me an email at mail@mattcassara.com.