Multiple Drag and Drop with jQuery

I took inspiration from David Walsh and updated his Drag and Drop script to be able to handle multiple Drag and Drop sections on one page at the same time. Plus I cleaned it up a bit by adding all the functions to a JavaScript object. As jQuery is my preferred JavaScript library this code is using the jQuery version. Checkout the demo /* create object */ function DragNDropList(selector){ this.list = $(selector); this.

JavaScript Documentation

A call for better JavaScript documentation has gone out and I am 150% in favour of it. Most of the existing JavaScript code, tutorials, and examples available on the web are just messy mashups that work, but are not code you actually want to use in a website. Therefore I am adding the PromoteJS wordpress widget to my blog and I encourage you to do the same. The world needs better JavaScript documentation.

Google Hosted jQuery

Google provides hosting for many of the most popular JavaScript libraries. I’m a big fan of jQuery so I’m going to show you how to use Google’s hosted version of jQuery and thereby removing resources from your web server and speeding up site performance. Performance can be increased because your user is going to download the jQuery file from Google’s CDN network and not from your server. Also, it could be even faster if the user visited another website that also uses Google’s hosted jQuery.

MySQL Gem on Snow Leopard

Snow Leopard does not have the mysql gem installed, and my last solution for installing it only work in OS X prior to 10.6.4; therefore, when you see the following error: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h Install the mysql gem with these steps:

mod_mono.so library OS X

Here are compiled versions of the mod_mono.so libraries built for OS X Snow Leopard as a convenience in case you don’t want to bother compiling them. mod_mono version: 2.6.3 Download 32-bit: i386 64-bit: x86_64

Ruby Subversion Bindings

Subversion has bindings for a variety of languages: Java, Perl, Python and Ruby. Of these I am most interested in the Ruby bindings as I’m building a Rails application. Unfortunately the documentation is completely lacking and bits of it are scattered throughout the web. This is an attempt to provide the code and how-to for the most common tasks. Before we get to the code, validate you have the Ruby Subversion bindings installed correctly by running irb from a terminal:

Debugging Form Errors in symfony 1.3+

Symfony 1.3 (or symfony 1.4) provides an incredibly helpful feature to help debug forms. This new feature is included in the developer toolbar and shows valuable information about the forms on the page. To access the detailed form information, click on the view button, click on the template or partial that the form is in, and then click to expand the form. It lists each form widget and if any errors for a given widget exist they are shown right under it.

What Will Web Development Look Like in 5 Years

Developing applications for the web has changed significantly over the last 5 years. Since 2005 the term AJAX has been coined, Ruby on Rails is now an open source web application framework, jQuery was created and has subsequently revolutionized JavaScript development, and now HTML5 is the top buzzword of the day. I believe the next 5 years will hold just as many improvements for web developers. I foresee a new framework will be created to make developing fully interactive AJAX applications as easy as it is to write current MVC applications.

Bash Basics

Bash is a shell scripting language included on most Linux and Mac computers. It’s useful for writing small scripts that don’t require another software language to be installed and are immediately portable. Good places to use bash scripts are when you want to write a cronjob, backup some files, or run an update task. Here are the basics to get you started. Start your script with She-Bang header: #!/bin/bash Variables are assigned by a key-value pairing:

HTTP Header to Force Browser Download

A content disposition header can be used to tell web browsers to ask the user where they want to save the file (and download it) instead of actually opening the file in a browser tab/window. Very handy if you want to have a download button. Content-Disposition: attachment; filename="filename.mp3" Tested in: Firefox, Safari, IE, Opera, and Google Chrome