A Progressive Web App is a great quick way to make your web app have a more native feel on a smartphone or even desktop. Despite the many good tutorials out on the web, I still had to read many articles and gather the best information from a few to get my PWA working, so I thought I should put forward the method that worked for me after a lot of trial and error.
The two things we’ll be adding are a file called manifest.json in the public folder and a serviceworker, which will take a bit more configuration.
In…
The final product, Flight Finder, allows users to search for flights and save flights. They can filter their search and results based on dates, prices, number of passengers, and other criteria. The app was built with Rails and React, though I’ll be focusing on the Rails part only, and my explanation should apply to other languages and frameworks as well.
NOTE: This is part 1 of an ongoing series. This will help you get started with the amadeus API and sdk, but it won’t get you all the way yet. I’ll be posting followup articles soon.
I made my app…
I wrote my first rudimentary web scraping program when I was new to coding. It gathered information from static Wikipedia pages, and the biggest challenge was making sense the HTML structure and parsing the data into a useable format. I only needed to write a program that was automated enough to be more efficient than copy pasting data line by line, table by table. For my hobbyist project, anything more would have been overkill.
But there are many new considerations that come into play when scaling up a web scraper to a business scale and it needs to run with…

A version of this problem can be found in LeetCode’s Top Interview Questions Easy Collection (account required). I hate the word “easy” in programming. It’s always relative. But if you’ve solved a few technical interview problems before, you can solve this one too.
This problem often comes with the stipulation that the rotation must be done “in place,” meaning we need to modify the original matrix and not generate a new one.
A matrix is an array of arrays. Digital images, for example, are essentially matrices, with each pixel being a cell of an array and each array being stacked…

In the process of learning algorithms, there are many case-specific solutions we need to learn. Not all can teach us broadly applicable lessons, though they’re still good to know. A few of these problems, however, are especially good for broadening our thinking and can give us tools that we can use in a broad spectrum of cases.
The Maximum Subarray problem was one of these eye-opening problems for me. The solution, using Kadane’s Algorithm, is a great introduction to dynamic programming and I think taking a little extra time on this problem is worthwhile. After studying this problem I knew…

Javascript’s spread operator, introduced with ECMAScript 2018, can be a very useful shorthand for expanding the contents of an object or array into a new context. Most articles and instructions I’ve found that explain how to use the spread operator are very good for most cases, but for a beginner they might be a bit misleading or incomplete.
After ‘copying’ or ‘cloning’ an object using spread, it’s possible to still modify objects within the original object from the one you spread into, and you could wind up mutating the original without knowing. …

Even when I really want to learn a new programming language, framework, or tool, the process of getting started with it can feel like a chore. But it helps when the reward is high, and it helps even more if you can see the reward quickly.
This was my experience learning to make fractals in p5.js. With less than 40 lines of JavaScript code, you can make your own adjustable and customizable fractal tree as well.
I recommend watching Coding Train’s video on making fractal trees as well.
The only resource you’ll need to get started is the p5 library…

If you’ve worked with ERB in Rails and need to learn JSX in React, this piece may help you carry over what you’ve already learned to the new format. It might also help you to understand the important differences between the two.
ERB is a templating engine that allows you to write Ruby code in an HTML file to generate the HTML the user sees on the client side. In a .erb file, the delineation between Ruby and HTML is clear, with ruby contained inside “squids”:
<%= ruby code here will render %> Or “ice cream cones”:
<% ruby code…Early in my time studying at the Flatiron school I had my first experiences in pair programming. Since we were learning object oriented programming in Ruby, this involved planning out models for our projects, modeling real world situations between a group of objects and the relationships between them. I enjoyed the exercises but I also quickly discovered my communication was falling short when I tried to build out these models with a programming partner.
At times I found myself becoming stubborn and even combative in an otherwise open and friendly environment. Our discussions kept circling back to the same point…

While researching for this post, I read a great article by Gretchen McCulloch on Wired about the oddity of English being the dominant natural language behind computer programming languages. You can find the article on Wired.com.
In this article, the author expresses a sentiment we can all relate to, whether we’ve written code or not:
“The fact that programming languages often resemble English words like body or if is a convenient accommodation for our puny human meatbrains, which are much better at remembering commands that look like words we already know.”
First, this is just so true. Learning to code…

Fullstack dev, data wrangler, amateur history nerd. music man.