/lib/web-dev

Projects, fun stuff, etc.

Exporting/migrating a Joomla website to Drupal7, with code

After building the new webiste for Kansas Public Radio using Drupal 7, I needed a way to export all of the old articles from our Joomla website to the new website. I could have experimented with the Feeds module for Drupal or another Joomla to Drupal solution, but our installation of Joomla was sooooo old and outdated that I couldn't trust anything. I decided to write my own bit of code.

Introducting: WowBox, a 3-dimensional HTML5 canvas plugin for jQuery

WowBox is a jquery plugin that adds some HTML5 canvass magic to any div on your website. With just a little bit of code, we can make some really super cool 3D effects. 

Javascript, Jquery form validation using Functional Programming techniques

I just put this together for a little project at work today and thought I'd share it with the world. 

The Reviews are In: Functional Programming in JavaScript "is AWESOME"

From the very beginning, the goal with Functional Programming in JavaScript was to strip the veneer off the language to expose its inner beauty and functional roots, a necessary step in helping the reader to fully understand both the language and the functional programming paradigm. And now that some reviews are coming in, it appears that the goal has been met.

Creating Podcast XML from Drupal content

I needed to create some podcasts for Kansas Public Radio, which uses the Drupal Content Management System (CMS). I couldn't find a satisfactory Drupal module that could create the RSS data that iTunes needs, so I had to come up with my own solution. IIRC, Drupal Feeds would have worked great but iTunes needs specific XML tags (i.e. <itunes:description>, <itunes:category>, etc) that Drupal Feeds couldn't provide. I also dried Drupal Views PHP but it was too buggy and I also couldn't get the code to output outside of the template.

I think I wrote a book: Functional Programming in JavaScript

You never know where life will take you. It may take you rock climbing in Argentina, it may take you to a farm in Nebraska, it may take you to a high-rise building in San Jose. Starting in October 2014, life took me (or, my name at least) to a publishing company in Birmingham, United Kingdom. A colleague of mine, Trent Hauck, wrote a book for the same publishing company and asked me to be a technical editor. I said sure! Little did I know that the experience would end up with me writing a book of my own.

Functional Programming in JavaScript by Dan Mantyla

Using Javascript/jQuery to check if offsite file exists with given URL

So I needed to see if an MP3 was successfully uploaded to our streaming server, and display the status on our website where our user's access the upload form. However, I ran into some issues with Access-Control-Allow-Origin access headers and with just how to acquire the status code. It always fails, whether or not the file does exists, because the browser doesn't allow XMLHttpRequest from a different domain to try and prevent cross-site-scripting. The solution? Using the JSONP datatype, a sort of consensual cross-site scripting hack!

CSS Monitor Screen Slideshow

Giving this one away for free. Javascript slideshow with a computer monitor created with pure CSS, with zoom to enlarge. Pretty cool!

css monitor slide jquery css3 javascript slideshow

How to add Google Web Fonts directly to your stylesheet

If you're using a CMS such as Drupal or Wordpress, it's not possible to add the link tag for the css file that google provides you&ndash; i.e. <link href='http://fonts.googleapis.com/css?family=Oswald:400,700,300' rel='stylesheet' type='text/css'>&ndash;without installing a module that would allow it (and who wants another module to maintain?). Here's a quick workaround I discovered that makes it really easy to simply add the css code you need directly to your stylesheet.

Inspect and save apache request headers

I wrote this function because one of our web apps that was communicating with our web server suddenly began receiving Error 406: Not Acceptable (The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request). So I inserted this bit of code to capture exactly what that accept header was and see if we could fix the problem. It writes the output to a file on the webserver.

Pages