The Problem

While coding on a project recently I ran into a situation while making an API request. The POST request (being sent from my frontend in REACT) in question was running into a security problem. Since I was sending a request from the client-side, it was violating a CORS preflight check and not allowed. After a bit of digging I realized the endpoint I was trying to hit didn’t allow CORS because at the end of the day, it’s just not secure enough when dealing with certain services. Many SAAS services don’t support CORS so I needed to find a way…


Route Route Baby

React Router allows for client-side routing and navigation without the need for page reloading. As such it is an incredibly powerful and lightweight way to navigate around single page applications. One of React Router’s best features is its suite of web hooks which, with a bit of practice, can be effective tools in keeping navigation simple in your next React app.

Getting Started

Before we get started with any hooks we need to make sure we have the necessary npm library installed to use React Router. We can do this by typing

npm install react-router-dom

when in our project directory. Now we…


No Chill Sesh?

My latest Ruby on Rails project brought me back to the confusing world of the session. Sessions always gave me a slight headache. There is a ton of reference material online but there never seemed a definitive way to start and end a session using JWT authentication that seemed satisfying. Today we are going to look at why sessions can be confusing and a solution that may work for you.

Code is in Session

Storing session data using a JWT (JSON Web Tokens) token is way to handle the information without requiring any hits to the database. When a user logs in, a JWT…


Fizzwha?

If you have spent any time at all looking for coding jobs you have at least heard about FizzBuzz in passing. The coding problem has been used in interviews for years to determine if a candidate knows how to write code. It goes like this:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

It is a simple enough problem with many implementations but we are going…


Tales From a Gitwit

Software developers from any background and experience level will most certainly have dealt with Github at some point. The online code-hosting platform is the most popular way for developers to collaborate on projects across the globe. Upon first dealing with Github while attending a coding bootcamp, I didn’t grasp how necessary it would be to understand proper procedure and flow moving forward in my new career.

Getting Started

The first step is to go to github.com and create a free account. This is pretty straightforward so we will skip to the next step which is creating a repository for you new project.

Creating a Repository


Faraday the Pains Away

Michael Faraday was one of the most important scientists in history. His discoveries in electromagnetism and electrochemistry changed the world and continue to influence our daily lives to this day. While it doesn’t share anything besides his name, the Faraday gem will similarly make your life easier. With Faraday, fetch requests from a controller in your Ruby on Rails project becomes a breeze.

What Is Faraday?

According to the official docs:

“Faraday is a simple, flexible HTTP client library, with support for multiple backends. Faraday also is a middleware.”

the key is that Faraday is simple. Compared to other concepts, Faraday is a…


Git Gone

I was recently coding on a Ruby/React app feature requiring a fetch to a third party’s database. The fetch required 5 different keys, including account id’s and a secret key, which I didn’t want anybody to see. My first impulse was to send the request on the client side but I didn’t want to expose any of these private keys as they would show up in my code pushed to GitHub. Previously I would include this information in the .gitignore file but I wanted to try a different approach this time. I felt like fetching from the backend might be…


Table With Columns Instead of Legs?

Structured Query Language or SQL is the language of databases. With SQL we have already covered how to write basic queries in order to find columns and/or rows matching specific conditions generated in our SQL statements. In previous exercises we had tables already made with which to pull our data from so let us take a step back and practice creating our database and tables.

Creating the Database

There are no tables to hold any data without first making the database. The SQL command for this is:

CREATE DATABASE awesomedatabase

This will create a new database called “awesomedatabase”.

WARNING!! Make sure you have…


WILDCARD!!!

If you’ve ever met anyone who had the inclination to do anything at anytime, you may already familiar with wildcards. They may not be the most reliable people in the world but they can be fun at the right times. Obviously we are not here to talk about impulsive people but rather the SQL Wildcard.

What is a Wildcard?

In SQL a wildcard is used when you need to substitute characters in a string. It is used in conjunction with the LIKE operator, which itself is used with the WHERE statement to search a column for a specified pattern.


Make Like a Server and Join Those Tables

SQL is an essential language to know. In my last blog I discussed some basic SELECT queries in order to illustrate how straightforward it can be to get started. The syntax for SQL can be slightly different depending on the program being used but overall it isn’t too hard to see what the (basic) statement is doing. The first SQL statement to make me stop and really think was the JOIN statement. Let’s take a look at why they are used and how they work.

What is a JOIN?

A JOIN clause is used to combine rows from two or more tables based on…

Joseph Patterson

I love traveling, music, and movies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store