Articles - languages

Javascript event delegation for a horizontal swipe effect

As front-end developers, there are times where we have to extend third party libraries or jQuery plugins in our applications. In this article I’ll show you a brief example of the javascript code that I used to extend the functionality of an image carousel in order to add a horizontal swipe effect using event delegation.

Filed under: languages, web

SQL delete at scale with Oracle

If you are involved in a project based on a critical and extensively used database, or if you are involved in stress and load testing, data maintenance is an issue you'll come across sooner or later.

Filed under: languages, infrastructure

Install and test the PostgreSQL gem with Ruby Version Manager

How to go about installing and testing the PostgreSQL gem using Ruby Version Manager, Ruby 1.9.2., Mac OS X 10.5.8 and Xcode 3.1.1.

Filed under: languages, tools

Validate and submit Expression Engine comment forms with Ajax using jQuery

On occasions it is useful to be able to “intercept” the normal submit behaviour of a form in order to validate it, send it to the server (via ajax) and then display the result to the user without reloading the page in the browser. In this article we outline one approach to achieving this with jquery for forms that have been generated dynamically within Expression Engine 1.6.X templates.

Filed under: languages, web

RegExp - keeping parts of a pattern in sed

Non-trivial use of regular expressions for pattern substitution often requires that a part of the pattern be kept after the substitution. The following sed examples show the basic usage of "variables" in regular expressions.

Filed under: languages, tools

Filtering lines in awk

The awk pattern scanning and processing language is frequently used in order to process lines that match a given criteria. Here we present several approaches to filtering with criteria.

Filed under: languages, tools

JUnit with Standard and Error output in main methods

Following a "there's no reason not to test" motto, here it is a simple way to perform unit testing on classes with a main() method. This idea is easily extensible and can be used to test methods whose outputs are sent to the standard and error streams.

Filed under: languages, methodology

Using sudo gem from behind a proxy

When trying to run a gem command from behind a proxy you may have the problem that although HTTP_PROXY is defined in your environment when you run the gem command with sudo it does not pick up the proxy setting.

Filed under: languages, tools