Published: February 03 2024
The below code sample shows how to add business days to a date, excluding weekends and public holidays in any specified country and state/region.
HTML encoding simply replaces HTML special characters like angle brackets with HTML entities so they can be displayed as plain text in a web page.
A slug is typically all lower case, separated by dashes (hyphens) instead of spaces and doesn't contain any special characters.
I recently integrated Google AdSense into my AngularJS blog and this is how I got it working.
This is a quick post to show how to add authentication and error handling middleware to all API routes of a Next.js 13 application.
Published: January 06 2023
This is a super quick post to show how to add an event listener to multiple HTML elements in pure JavaScript.
Published: January 04 2023
This is a quick post to show how easy it is to implement modal popups in pure HTML, CSS and JavaScript.
Published: December 16 2022
This is a super quick post to show how to sort an array of objects by property value in JavaScript (or TypeScript).
Published: December 06 2022
This is a super quick post to show how to initialize an array with conditional values in JavaScript (or TypeScript).
Published: October 15 2021
Some quick examples of how to convert a string to a number in JavaScript
Published: October 02 2021
Some quick examples of how to generate a range of numbers in an array in JavaScript.
Published: September 14 2021
A quick example of how to get the maximum value of a property in an array of objects in JavaScript
Published: August 23 2021
This is a quick post to show how to implement a global exception handler in a Next.js API.
Published: August 20 2021
This is a quick post to show how to add middleware to the request pipeline of a Next.js API so it supports similar functionality to ExpressJS.
This is a quick example of how to validate HTTP request data using the joi schema validation library in a Node.js + Express API.
This is a quick example of how to send an email in Node.js using the nodemailer email sending module.
This is a quick example of how to hash and verify passwords in Node.js using the bcryptjs password hashing library which is a pure JavaScript implementation of the bcrypt password hashing function.
Published: April 22 2020
Last updated: July 06 2020
How to build a boilerplate authentication system in React including email sign up & verification, authentication & role based authorization, forgot password & reset password functionality, view & update my profile section, and admin only section for managing all user accounts.
An example of backendless development with React and the Fetch API, includes "pass through" to real backend for unmocked URLs.
Published: August 21 2019
A simple example of how to implement client-side pagination in Vue.js.
Published: August 12 2019
A simple example of how to implement server-side pagination in Vue.js with a Node.js backend API.
A simple example of how to implement server-side pagination in React with a Node.js backend API.
A simple example of how to implement server-side pagination in Angular 8 with a Node.js backend API.
Published: November 28 2018
Last updated: July 02 2020
How to build an API with role based authorization / access control in Node.js & JavaScript. Includes example client apps built with Angular, React and Vue.
Published: September 24 2018
Last updated: September 10 2020
How to implement Basic HTTP Authentication in Node.js with JavaScript. Includes example client apps built with React, Angular & Vue.
Published: August 07 2018
Pure pagination logic written in JavaScript and available on npm
Published: August 06 2018
Last updated: April 14 2023
How to implement JWT authentication in Node.js with Express.js. Includes example client apps built with React, Angular, Vue & Blazor.
Published: June 14 2018
Last updated: July 02 2020
A clean and simple custom NodeJS API for Login, Registration and User Management. Includes example client apps built with React, Angular & Vue, and instructions on testing with Postman and deploying to AWS and Heroku.
How to get the public key from a private key using JavaScript running on Node. Useful for AWS Key Pairs.
How to embed a plunk showing only the preview pane, plus other display options.
Published: February 09 2016
Last updated: July 29 2021
How to add an animated sticky header to a website using almost pure CSS with just a touch of javascript.
Published: January 31 2016
Google style pagination logic in AngularJS and JavaScript.
Published: November 07 2015
This is a quick post to show how to setup Google Analytics page/route tracking in an Angular application that uses the UI Router.
An example of how to setup a simple login page with HTTP Basic Authentication using AngularJS, and also keep the user logged in after the page is refreshed.
How to post a simple string parameter in the body of an HTTP request from AngularJS to ASP.NET Web API
The simplest way to setup controller inheritance in AngularJS.
Published: February 15 2014
This is a little custom AngularJS directive that converts GPS coordinates (latitude/longitude) into an address, otherwise known as reverse geocoding, using the Google Maps API.
This is a handy javascript function that I use on a lot of my sites to ensure that the html5 placeholder attribute is supported by older browsers.
Published: December 16 2011
I recently tried out the jQuery Searchable DropDown (v1.0.7) from http://jsearchdropdown.sourceforge.net/ and it worked perfectly except for 2 things:
Published: November 18 2011
A simple javascript function for validating a date that's input using 3 dropdown lists