Category Archives: Web Development

WordPress RSS – Invalid Feed Error

While trying to make WordPress and Mailchimp work better together, I was having a hard time getting Mailchimp to accept my blog’s RSS feed. After some research, I noticed that the XML wasn’t formatted properly, as the feed was emitting a blank line before the XML declaration. Many of the other help docs I found online recommended hunting for extra lines in my theme’s functions.php file among others. After a few minutes of that nonsense, I figured there must be a better way. I knew that I didn’t want anything output before the xml declaration, so I figured if I just cleared the output buffer prior to echoing the xml declaration, that should do the trick. Sure enough, it worked.

nano \wp-includes\feed-rss2.php

Insert the following line just prior to xml declaration:

ob_clean();

Saving money with Azure SQL

I’ve messing around with Azure for quite a while. One of my my biggest complaints has been that the pricing often doesn’t pencil for smaller web projects, especially when that project utilizes SSL certs or a backing database.

In learning about Azure Synapse for a larger project, I stumbled across the mention of serverless Azure DB that can auto-scale and more importantly, for my small projects’ bottom lines, auto-pause. Now my projects that only use a handful of hours per month can function on-demand 24/7 without the need of having a provisioned DB that I’m getting charged for all 24/7.

One gotcha I ran into while switching from the Basic pricing tier to Serverless was that the conversion was failing for an unspecified reason. It turned out the reason was that I had Long Term Retention (LTR) setup on my server. Make sure to zero out any LTR settings you might have and retry the conversion.

Exporting SVG graphics to PNG or JPG

Over the past 6 months, I’ve had the pleasure of working on a project that sought to use d3.js to generate custom graphs on the fly. The learning curve was a bit steep and I still wouldn’t consider myself a d3 expert, but we’ve managed to come up with a tool that allows users to select one or more data sets and graph them over a custom time span with options to tweak line colors and styles. The customer was pleased, but now that they had these impressive graphs, they wanted to be able to export them as images for use in their reports.
Continue reading Exporting SVG graphics to PNG or JPG

Away we go

Welcome to my professional home.  I’m Josh Piper and I’m a full-stack web developer, located in Portland, Oregon.  I’m a huge fan of Twitter, but sometimes I need more than 140 characters to document the thoughts rattling around in my head.  I hope to use this site to document some of interesting things I learn along the way.