Enums are great to help you strongly reference values without using “magic” strings. Normally I use them in conditional if statements. However, recently I wanted to get all values into a List, where T is your Enum. Let’s explore how Enum.GetValues will help.
Blog
-
JavaScript String concat() Method
The Javascript concat method is a great function and this article will hopefully answer your burning question of how do you concatenate strings in javascript?
(more…) -
Access query string parameters with Express and Node.js
Passing data through the URL is a very common practice. As you can see with the URLs on my website, I pass – what I call – a slug of my post title in the URL. In this case: access-query-string-parameters-with-express-and-node-js. With this data I can figure out dynamically what blog post to show. Another common way is to use query string parameters such as ?id=1. There are two common ways that I perform this using Express and Node.js.
-
jQuery HTML Templates
There is an updated version of this article: jQuery HTML Templates: 3 Solutions to get you started
When you have a lot of AJAX calls on your website, especially ones that return a list of data, it can be quite expensive processing time on the server to retrieve the results, format them with HTML, and return them to the browser to display – not only that, your bandwidth costs can be quite high as well. With jQuery templates, you can alter your AJAX calls to return JSON leveraging Javascript event handlers, and then populate the content client-side providing faster response times and less server processing as well from an external file or JSON object.
-
Creating a Background Gradient with CSS
To create a gradient background image with CSS, you need two things: a starting color and a bottom color. It would also be handy to have a potential “fall back” background color that sits somewhere in the middle of the two.