React apps in subdirectories that use React Router

If you’ve ever deployed your new React app to a subfolder on your server and you’re using React Router you might notice that React Router starts getting all funky and truncates the subfolder name.  This is the expected behavior, albeit something easy to overlook when deploying to a subfolder.  The good news is that there is a pretty straightforward solution: just add a basepath  to your Router and specify the folder name.

Check out the documentation.

For example, I deploy most of my playground apps to apps.bioramp.com, to deploy the Auto9 app I use a subfolder and the resulting URL is http://apps.bioramp.com/auto9

This is what my Router looks like for that app (keep in mind I import my routes from an external file).

Also, keep in the mind that you should have a “homepage” node in your package.json before you a do a build.

Collective intelligence vs. Superstar Developer

Lunar Logic has an excellent post about why it’s not always about the developer skill set but more-so how well the developer integrates into the team.

From my experience, cowboy coders and catfish programmers can be remarkably effective but there’s nothing more powerful than a solid team working together towards a common goal.

“None of us is as smart as all of us.” -Kenneth H. Blanchard

It’s all about the team, yo.

Github and Facebook launch the Atom IDE

For a few months Danny had me determined to work with and love Atom.io. It never happened.

Atom certainly is snazzy enough, and neon syntax plugin was fun (but ultimately became like Cathode vintage terminal and the retro fun faded after awhile). Cool enough, but not enough to make me switch.

A personal requirement for me with any editor is the ability to use multiple cursors. Atom came to a crawl (if not crashed) any time I had a large number of multi-cursors active.

The Atom IDE seems like a cool idea (and I applaud GitHub and Facebook for creating and open sourcing it), but I just don’t see how this could dethrone my current favorite IDE: IntelliJ or my current favorite editor: VS Code.

Official Atom IDE Launch Announcement

Using json-server for local mock API

I keep a boilerplate Rails 5 API-only app among my repos for rapid API building, but sometimes I just want a basic structure to query against (without having to deal with a complete stand alone Rails app).

Enter: json-schema-faker and json-server

Cory House has put together a great tutorial on how to build and serve a json database in 3 easy steps:  https://medium.freecodecamp.org/rapid-development-via-mock-apis-e559087be066

Using SMTP relay via Office365 in Rails apps

First you’ll need to add your production box IP address to Exchange Connector

Example URL: https://outlook.office365.com/ecp/?rfr=Admin_o365&exsvurl=1&Realm=yourdomain.com

Then add the following to application production.rb

and boom! your Rails app will start sending emails through Office 365.

Nginx setup with SSL on Ruby app running Passenger

Once you’ve got your certs all setup you can add an entry to /etc/nginx/sites-available and then symlink it to /etc/nginx/site-enabled

An example snippet below: