There are a lot of tutorials and examples of AngularJS services that make a single asynchronous request and return a single promise, but I haven’t seen many examples of complex, nested requests. With this example I will demonstrate a few complex promises in AngularJS.
After migrating web hosts, I encountered a most annoying problem: WordPress permalinks were not working for one of my sites. The main WordPress page loaded just fine, but every attempt at navigating to a post resulted in a dreaded 404 File Not Found error. When hosted on an Apache web server, WordPress uses a .htaccess file to enable pretty permalinks. The Apache Software Foundation, however, discourages the use of .htaccess files. These files can be used to configure directory-specific options. It is recommended to put directory-specific configuration options in the main apache configuration file instead of the .htaccess file. Doing this actually fixed my problem. Continue reading →
When performing calculations in T-SQL, I found myself having to deal with zeros in division operations. While zeros in the numerator pose no threat, denominators of zero will cause your query to blow up. In order to fix divide by zero errors, I began writing
CASE statements. However, this got old very quickly. The stored procedure I was working on had tons of division operations. Writing
CASE statements for all of these would be insane. There had to be a better way! Enter
NULLIF, the extremely easy way to fix divide by zero errors in T-SQL. Continue reading →
As a New Year’s present to myself, I recently signed up for free SSL certificates through startssl.com for my personal websites. Since these are not production websites, I did not want to pay for an SSL certificate that covers multiple domains. Instead, I hoped to use multiple (free!) SSL certificates within IIS 8 to encrypt my website traffic. When attempting this, I ran into a roadblock. If you assign a certificate to website1, and then try to assign a different certificate to website2, IIS gives you a nice info box that tells you that this is impossible. Fortunately, IIS 8 Server Name Indication provides a solution.
Continue reading →