These are the methods we’ll look at in this post.
I’ve been working on a Next.js project for a few weeks and have been experiencing intermitent issues with page CSS not being loaded when the page is refreshed. I tried a few different things but didn’t have much success. I sort of hoped the problem would go away when I made a production build but no such luck.Read more »
I like to start each year with a general roadmap of things I would like to improve, learn, or at least gain some more exposure to. In that spirit, here is what is on my list for 2019.Read more »
If you’ve spent much time on back-end development you probably have at least a basic understanding of database joins - what they are and how they work. At a basic level, joins are a mechanism to utilize primary and foreign keys to fetch related information from multiple tables. In most cases we use a single field from each table to make the connection, but what about a situation where a table may have multiple references to another table? Let’s look at a scenario where that may be required and how we can work with it.Read more »
There may be situations when you only want to apply certain redux middlewares. For example, I typically use
redux-logger but I don’t necessarily want to include the logger in my production build. One way to accomplish this is to add any middleware you want to use into an array, which allows you to apply your conditional logic to determine what should be added, and then use the spread operator (…) to apply that middleware.
If you reading this to learn how to send the beautiful HTML email you just finished designing, you’ve already done the hard part. While designing HTML email is a pain, sending HTML email may required an additional step or two than what you’re used to but it’s still super easy.Read more »
This is something I feel like I should have known, but didn’t. By default, Nginx only applies gzip compression to
text/html MIME-types. This means any additional assets like css, js, fonts etc. are not compressed.
I had an opportunity to teach a Computer Science class at our local community college for this upcoming fall semester and was allowed to choose a topic/language and develop my own curriculum. Teaching has always been something I’m interested in so I was really looking forward to this experience. After spending a good bit of time this summer developing curriculum, I have to admit that having never done it before it’s been harder than I expected (but still fun!). Unfortunately, after several weeks of planning and with about 1 week left before the start of the semester the class ended up being canceled. That was certainly a big disappointment, but there is a chance that class will run again next semester. I wanted to share my thought process as well as the general outline of the class topics, and would appreciate any feedback from readers.Read more »
For security purposes you may not want objects stored in your AWS S3 buckets to be publicly accessible (and by default, all objects in S3 are private). However, you likely still need to be able to serve them to properly authenticated users. This can be done by utilizing pre-signed URLs.Read more »
More often than I care for I find myself needing to write data to a csv file. This certainly falls under the “less than interesting” category of things I work on, but you have to take the good with the bad, I guess.Read more »
Occassionally when writing SQL queries the number of fields that we need to filter on may change depending on user selection. Let’s take a look at how we can build dynamic ‘where’ clauses and the corresponding parameter array to handle this scenario.Read more »
So you have decided to use JSON Web Tokens (JWT) to secure your API, or you are already using JWT and need to add some unit tests for your routes, and you are a little unsure how to acquire, store, and pass the required token to complete the test. Let’s take a look at how to do this using Jest and SuperTest.Read more »
During the development process there may be times when you need to allow public access to your local development environment. You may want to demo your progress to a client or test an incoming webhook, for example. With ngrok (https://ngrok.com) there is no need to push to production or some other public facing environment in order to accomplish this.Read more »
Generally, when content is returned from a web server to a browser it is intended to be displayed inline, meaning rendered as a web page or as part of a web page. This is especially true for file types such as images, html documents, PDF documents, etc. that can be rendered natively by web browsers. There are times, however, when we would rather have the user be prompted to download and save the file locally. Here is a quick look at how we can send files from S3 (or other remote locations) to be downloaded and saved locally on the client.Read more »
It worth it to invest some time reaching a good solution for managing environment configuration settings and secrets for your apps to support multiple runtime environments (development, production, staging, etc) and multiple developers. These settings will likely require different configurations, depending on environment and/or developer, for things such as database connection information, log settings, API keys, usernames, passwords, etc. Additionally, we need to keep some of this information from being included in the codebase or repository but still be easily maintained. Let’s look at 2 packages that when used together create a nice solution to this problem.Read more »
Handling file uploads in a React/Node/Express application is done a little different on both the server-side and client-side than what you may be used to doing when handling regular form submissions. In this post we’ll take a look at code on the server and client for uploading a file from a React application and saving the file on the server using Node.js and Express.Read more »
I spent far too much time when I was first getting into React development trying to maintain my own boilerplate for new projects. Even though I don’t use any of that old boilerplate code anymore, it wasn’t time completely wasted as I learned a good deal about the React ecosystem, especially webpack. But eventually the process became too tedious and, frankly, I wasn’t doing anywhere near as good a job as what others had already done. So now I start every new project with
create-react-app (https://github.com/facebookincubator/create-react-app). It’s an incredible tool but it doesn’t include support for Sass, which I often use. So I must add that to the configuration and build process manually.
It’s good UX to provide visual feedback to the user of web applications when an asynchronous operation is taking place. We’ve all seen these ‘loading’ indicators in the form of spinning icons, overlays, modals, etc. as we wait for view data to load. Here is a quick look at how we can implement a ‘loading’ indicator when using React.Read more »
I was reading through a thread on Reddit recently with some users discussing React. One particular user seemed a little frustrated with his/her understanding of React and had a few specific complaints about form data and submissions. I decided to put together an example addressing each of the issues (s)he is having.Read more »
As I first started to work with React and familiarize myself with it’s one-way data bindings I found that I must re-think some of the ways I’ve solved seemingly trivial problems before. One such issue is dealing with custom client-side form validation. There are no shortages of ways and opinions on how to do this, and numerous packages exists to solve this very problem (with, IMHO varying degrees of success). However, as I head down the path of learning something new I don’t mind reinventing the wheel as it often helps the learning process.Read more »
I recently observed a Twitter discussion with some former (and soon to be former) ColdFusion developers, most notably Raymond Camden (@RaymondCamden), Adam Cameron (@DAC_dev), and Todd Rafferty (@webRat), regarding their decision to move on from ColdFusion as their primary web development platform. Adam decided to come up with a list of questions for current and former CF developers to gather their thoughts on this topic. As a former ColdFusion developer who has moved on to Node.js, I thought I would add my $0.02. Adam’s blog post regarding the survey can be found here. My responses are as follows:Read more »
So much of my work is web development related that when something different comes along I can geek out on it pretty hard. It’s even better when it’s an opportunity to save our organization money. A recent need for a command line script to search and split a PDF file satisfied both.Read more »
The MySQL package is a hugely popular library for working with MySQL from Node.js, and with good reason. It’s performant, easy to use, battle tested, and well documented. I was a bit surprised, however, that the documentation doesn’t show the syntax for performing parameterized ‘like’ queries.Read more »
I was recently working on a demo project and found myself constantly creating and deleting views. Rather than having to keep updating my routes I wondered if I could create a dynamic route handler that would match a view with a requested route.Read more »