I recently had to convert an application from using session-based authentication, managed by passport and Sails.js on the server, to JWT authentication. This is a quick breakdown of the steps used to accomplish this.
Sails.js is one of my favorite Node frameworks. There are a lot of built in advantages that make getting up and running quick, easy, and painless. One of the benefits is the ORM/ODM that it comes with, Waterline. There are a lot of adapters that allow you to use many different databases with your application and no need to rewrite the database access code. This time, though, when using Waterline I got a little stuck, but here's how I got the data I wanted.
SQL Server is a powerful database option to use, but up until recently it's not been possible to use it unless you were on a Windows machine. Well, that's changed (along with many other Microsoft products). This week at work I decided to finally jump in and get SQL Server running on my Mac using Docker. Here's a quick recap of how I did this.
This week I needed to turn an Angular module into an npm package that I could import into multiple projects. The tough part was that in this module, there was a service that posts to a URL which needed to be configured. Luckily, Angular provides a pretty simple way to do this, although it did take a little time to learn exactly how to do this. Hopefully by the end of this blog post you'll be able to do the same in your app.
Angular 4.3 introduced HTTP interceptors. This gives you the ability to handle every outgoing http call and every incoming response, all in one spot. Most of the examples I've seen out there cover the first, with each call having an authentication token attached to the call. I needed a way to handle and display errors on HTTP calls, and didn't want to put the error handling on every single call I make. This is a quick example of how to implement this in your app.
Today I got the opportunity to give a presentation at Dev Mountain in Provo, UT on why you should use Sails.js, an MVC framework for Node. There are a lot of reasons, but I wanted to share some of my favorites.
I dont' know how many of you have tried to vertically center HTML elements before, but it can be a big pain in the butt. A coworker had once given me some hints and a couple of CSS classes that I could use to achieve it. It really wasn't easy though, and hard to have other people come behind and know what's going on.
Last week I attended my first ever developer conference. Or any conference, for that matter. ng-conf 2016 was a blast!
Today I finished my first beginner tutorial on React.js from Pluralsight.
This lesson in the React.js tutorial I'm doing focused on getting data from the GitHub API and displaying it, dealing with user input, and looping through an array of items and outputting them.
I decided I really needed to start learning React.js. It's the big thing these days, and I don't want to get too far behind, so I'm starting to get on the bandwagon.
The more I use Sublime Text, the more convinced I am that it's the best text editor there is. It's just so powerful, has so many plugins, and offers users so many more options than other editors. I read through @wesbos's book, Sublime Text Power User, and my developing life has been changed forever.
I wrote my first Sublime Text 3 Plugin! Granted, it's nothing overly complicated, but it will save me a lot of time. I spend a lot of time copying and pasting text from Photoshop mockups, or from e-mails, or whatever it may be. I would then always forget to double check that the apostrophes, quotation marks, and ampersands were replaced with the proper plain text or html code versions. So many times I was getting e-mails back asking me to fix that. So instead of manually changing it by hand every time, I decided to learn how to automate it for me.
I recently found a pretty cool new piece of web development technology: Firebase. You can read more on their site, but basically Firebase is a way to instantly sync data across devices. If you make a change on your computer, it instantly shows up on your phone. They take care of all the details; you just add, update, or delete and you're good to go.
I wrote my first AngularJS service today. It was nothing big, I was just trying to keep from repeating code on every screen. On the site, an alert shows up after a user adds or updates a record. Angular-ui-bootstrap was giving me most of the functionality I wanted, but it doesn't have a way for the alerts to close automatically after a certain amount of time. I had already figured out how to get around that, but I was repeating the code in every controller. So I went ahead and wrote a service for it.