I have recently started converting a few of my React web apps to React Native and I’ve really enjoyed how straight forward the process has been. Most of the learning has just been finding out which HTML tags correspond to which React Native components. Any logic of state or loading of external resources can stay the same, because you’re still using React (at least for the use of Hooks which is what I’ve used so far). I though I would share what I’ve learned so far for anyone else who wants to convert their web app to Native. …

A common theme in dynamic programming algorithm questions on Leetcode or in job interviews, is that the underlying problem is some twist on or manipulation of the numbers of the Fibonacci sequence. The Fibonacci sequence is a series of numbers where the next number is the sum of the previous two. Normally it starts at 0,1 followed by 1,2,3,5,8,13,21 and so on. To find the nth number of a Fibonacci sequence, we can use a for loop to sum it up iteratively using something like the following:

const fib = (n) => {
if (n === 1) return 0…

Pinky promise clipart 3 » Clipart Station

Have you ever tried to set the results of a fetch to a variable, but once you run your code the variable does not contain any data you hoped to get back? If you log your variable to the console or check it in a debugger, you may notice your variable’s value is an object called Promise. What exactly is this object?

Per the MDN Web Docs, a “Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.” The Promise object can have three states: pending, fulfilled, and rejected. …

When creating a Ruby on Rails backend, you may want to utilize an external API or set up JWT. In the case of an external API you will likely need an API key when making requests to the server. If this key is exposed to the public and someone were to find it, you could end up incurring large fees depending on the external APIs charging system. With JWT your token is encoded with a secret. If your secret lives within your code and it exposed to the public, it’s not much of a secret anymore and could be used…

You may have set up a Rails project using the default values, but now want to deploy it to a hosting site such as Heroku. If you follow the instructions on Heroku to push your project to their site you may receive the following error:

 !     Detected sqlite3 gem which is not supported on Heroku.
! http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
! Heroku push rejected, failed to compile Ruby/rails app

As the error message states, Heroku does not support the built in database management system (DBMS) for Rails, SQLite.

Why not?

As this is such a common issue for Rails developers the first time they…

As your webpage grows in size, it may become more difficult to grab the elements you’d like to edit. Javascript gives you multiple powerful tools to select the items you’re looking for, but it can be confusing on which one to use. In this blog I will go over a few that I’ve learned and where I’ve found them most applicable.

<!DOCTYPE html>
<html lang="en" dir="ltr">
<meta charset="utf-8" />
<title>Javascript DOM Element Selectors</title>
<script defer src="./src/index.js"></script>
<h1>DOM Selectors I Have Learned</h1>
<div id='learned-selectors'>
<li class='pretty-text'>document.getElementById()</li>
<li class='pretty-text'>document.getElementsByClassName()</li>
<li class='pretty-text'>document.getElementsByTagName()</li>
<li class='pretty-text'>document.querySelector()</li>
<li class='pretty-text'>document.querySelectorAll()</li>

Do you have a large excel file that you would like to get into your ruby program or rails database? There’s a gem for that! Either install the csv gem and require it, or add it to your Gemfile.

$ gem install csv

#in your .rb file

require ‘csv’

or in your Gemfile

gem ‘csv’

Once you have the necessary gem, you can now use the CSV class and its methods. The CSV class has around 125 methods, but I’ll only go over a few here.

CSV files

As the name of the gem suggests, the Excel file you want to use…

Andrew Mullan

Current Web Development student at https://flatironschool.com/

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