It’s quite often that I have an array of elements and when a certain condition happens that I need to remove a particular element from my JavaScript array. Let’s explore how indexOf and splice accomplish this.
Author: Jamie
-
Setting up SSL with nginx including redirects from non HTTPS traffic
In an attempt to improve security and privacy on the Internet, Google is encouraging websites to secure their site with an SSL certificate, aka https:// instead of http://
As you may have noticed, I just officially updated my domain to be under SSL. As I described in my It’s LEMP not LAMP post that I use nginx for my web server. I thought I would share how easily I was able to convert my website to use SSL with nginx.Before you begin, be sure you have already created your SSL certificate and have your certificate and private key files ready and uploaded to your server (I got my SSL cert free with my domain registration at Porkbun).
-
C# Improving string.IsNullOrEmpty readability
I often find myself using this great C# function: string.IsNullOrEmpty. It is the assured way to confirm whether a string is empty – null or otherwise. However, I often find myself wanting to know when it is not empty, so I wrote an string extension named HasValue.
-
C# OutputCache with subdomains
The other day I was working on a project that was leveraging OutputCache. This little attribute is a fantastic way to implement caching in an MVC project. This was working great until I encountered a snag when using a subdomain.
-
Difference between location.href and location.replace
It’s quite common to redirect a user visiting your webpage with javascript location href, more specifically when they perform an action, such as: clicking a button. When the user completes the action and you want to redirect the user to somewhere else, you have two common choices: window.location vs window.location.href
(more…)