Ruby Array Set Operators

intersection

Have you ever had an array that you only want to include unique elements?

In this example we’re combining list_1 and list_2, then removing duplicate entries using the #uniq method before assigning to the combined_list variable.

Another approach would be to not include duplicate elements all together using one of the array set operators: the union operator |.

Read More

Guard Clauses vs. Nested Conditionals

Guard Rail

TLDR; a guard clause is a premature return (early exit) that “guards” against the rest of your code from executing if it’s not necessary (based on criteria you specify).

Soon after I started my career as a Ruby on Rails developer I learned about guard clauses and how they can improve code readability.

Read More

Stock Game - A React & Ruby on Rails Project

Chart of a random stock

For a working demo of the project, visit: https://anonymous-stock-game.herokuapp.com/

For my final project at Flatiron, I created The Anonymous Stock Trading Game. It was an idea I had several months ago and decided to make it my final project.

My original idea was to show the first half of an anonymous chart before the game starts. Then once the game begins, update the chart with each new day and see how much a player could make (or lose).

I started sketching my idea out and soon realized the game would be more fun if the player was given no historical price context at all! Just a blank chart that only starts to update once the game begins!

Read More

How to create a global .gitignore file

Add a global .gitignore

  1. Open the Terminal
  2. Run touch ~/.gitignore_global to create a global .gitignore file in the home directory
  3. Run open ~/.gitignore_global
  4. Add .vscode/ and any other files or directories that you want to ignore and not include in project-specific .gitignore files (don’t forget to save!)
  5. Run git config --global core.excludesfile ~/.gitignore_global

That’s it! Using .gitignore_global will let you customize your editor without having to edit and commit changes to the .gitignore file for every single project.

Read More

Ruby If, Unless, While and Until

Decisions, decisions

Ruby offers conventional control structures that are found in most common programming languages like if, else and while, however, Ruby also provides less common options like until and unless. These control structures may seem weird at first (“who talks like that?”), but they have their advantages.

Read More

How to Reverse a String in JavaScript

Choosing the right tool for the job

This article is about practicing different JavaScript functions and creating algorithms because it is important to practice in order to perform well in technical interviews. This article will teach you several approaches to solving a common technical interview question, reversing a string.

Reversing a string in JavaScript may seem like a simple task, but there are several steps involved and, in the context of a technical interview, it provides opportunities to showcase your knowledge of JavaScript and trade-offs / edge cases considered. It is good practice to make sure you understand the problem and any constraints before beginning to write code.

Read More

Shelter Gifts - A Ruby on Rails Project

A representation of what Shelter Gifts is all about

For a working demo of the project, visit: https://shelter-gifts.herokuapp.com/

For my first Ruby on Rails project (my third project for Flatiron), I created Shelter Gifts. I came up with the idea for the app several months ago, well before reaching the Ruby on Rails section in the curriculum. I started following DHH on Twitter a while back because I was looking forward to learning Ruby on Rails and he created it! Well, in February he retweeted something from from Ryan Singer that stuck with me:

That got me thinking: what are some problem spaces that I could address? What areas could I help in and where? That changed from what and where to who. Who are the people in problem spaces? Who are some people with problems? Everyone has problems. Who are the people with some of the biggest problems? People that are homeless.

Read More

What Is MongoDB and Why I Want To Learn It.

The MongoDB logo

I recently decided to commit to learning MongoDB. I’ve noticed comparisons between SQL and NoSQL databases online, and although one is not necessarily better than the other as both serve different purposes, I decided that it would be beneficial to me as a full stack developer to know both as it is part of the MEAN stack. So last week I signed up for MongoDB’s MongoDB Basics course. It is a 3-week course that teaches you how to use Compass (the MongoDB GUI), the document model and schema design, the MongoDB query language and how to use Atlas (their hosted database as a service).

My ultimate goal is to become a MongoDB Certified Developer Associate. This post is my public commitiment to my timeline below and to acheiving my goal!

Read More

Developer Journal Sinatra App

A screenshot of the Developer Journal app with sample data. I am a huge The Walking Dead fan by the way!

For a working demo of the project, visit: https://developer-journal.herokuapp.com

For my Sinatra project, I chose to build an app that I’ve wanted to use but haven’t quite found. Since I’ve been in Flatiron’s Full Stack Developer Program I’ve wanted to keep track of what I’m learning, view my learning/coding “streaks” and set goals for myself.

I’ve used a combination of DayOne for journaling, Quiver for organizing my notes and different goal tracking iOS apps. Individually, these apps worked for their specific purposes, but together they were too cumbersome for what I wanted; so I decided to make an app with the features I was looking for.

Read More