In this tutorial we will cover how to build a module from scratch in Kohana 3. If you aren’t familiar with the Kohana framework then I recommend you read the beginners introduction to Kohana.
The Plan
We will be building a module that replaces Kohana’s own view layer (Kohana_View). It will use the PHP template library Twig. We want our own view layer to be API compatible with Kohana’s view layer. This will ensure that other modules work out of the box and that the only code the developer will need to alter in their application are the templates (so that they are Twig compatible). No code in any controller will need to be modified.
Because Kohana follows HMVC (see beginners introduction to Kohana) we will be calling our class View. This means that all calls in the application to the class of View will be to the View class in our module, not Kohana’s own View class.
Directory Structure

Enabling The Module
The name of any Kohana module is the same name as the directory inside the modules directory. So in this case it is twig. To activate any module, we must add it…
App Engine 1.4.0
Two big changes in the latest Google App Engine release have been the new Channel API and the new 10 minute limit for background processing with a new Task Queue API. Both of these have been highly requested features for some time.
The Channel API creates a persistent connection between your application and Google servers, allowing your application to send messages to JavaScript clients in real time without the use of polling. This is useful for applications designed to update users about new information immediately. – Google
Expect to see the Channel API used for chat applications and real time games. The new Task Queue API allows developers to easily set up long running task jobs. Prior to GAE 1.4.0, scripts could run for a maximum of 30 seconds before they were terminated. Now scripts (using the Task Queue API) can run for a maximum of 10 minutes so data manipulations will be able to be performed on App Engine rather than on an external server.
PHP Maintenance Release
PHP 5.3.4 and 5.2.15 are now available. Both contain numerous bug and security fixes from their previous versions. Support for the 5.2 line is…
This is a brief introduction into the Kohana framework. The next two tutorials will cover how to build a blog in Kohana.
Installation
Installing Kohana is very straight forward, just download the latest stable version of Kohana and unzip it. No need to mess around with yaml or xml files like other frameworks. Navigating to the directory on your web server should give you a page similar to…

Filesystem
The filesystem plays a big part in the operation of the Kohana framework. Kohana follows the HMVC pattern (hierarchical model view controller). This means that the same filesystem structure exists at multiple locations in the framework. The following directories exist in the application, system and in all module directories:
- classes
- config
- i18n
- messages
- tests
When calling a class in Kohana, the autoloader checks if the class exists first in application/classes/ , then in each of the installed modules, classes subdirectory and finally in system/classes/. If the file cannot be found then an exception is thrown. Kohana follows the Zend_Class_Naming style. For example, if you instantiated a class named Hello_World, Kohana would look at each of the following locations in this order. If it finds that…
Lets make a [javascript] framework
Alex Young has been writing a series of articles detailing how to create your own javascript framework. So far he has covered DOM selectors, events, AJAX, animation, chained APIs (similar to jQuery) and testing. He goes into great detail regarding each of the components and provides clear code snippets. This is a great resource for anyone who understands the fundamentals of Javascript and would like to learn how frameworks are made. I personally found the animation section very interesting as there isn’t a whole lot of content detailing about how animations work on the web. All of the framework code is open source on github.
You can read the series online or download it in several different eBook formats from the DailyJS blog.
Symfony PR4 released
Symfony PR4 is most likely the last preview release before Symfony2 hits beta and that it comes with all features intended to be in the final release of Symfony2.
The latest pre release of Symfony2 includes code and documentation support for:
The HTTP caching feature of Symfony2 is interesting as none of…
A couple of weeks ago, Ajax.org released a new IDE for Javascripters known as Cloud9. It’s an open source project built on Node.js. In case you don’t know, Node.js is an implementation of Server Side JavaScript (SSJS) and is now actively being used for SSJS development. Since Cloud9 IDE is built on top of Node.js, it has an integrated debugger for Node.JS applications. In this article we’ll be taking a look at various features of Cloud9 such as those mentioned above, but for now let’s begin with installation.
Installation
Installation is very simple provided you’re familiar with the terminal. There are three ways to install Cloud9:
1. If you’ve Git installed on your system then you can get the code repository directly from Github. Just enter the following command in your terminal:
git clone git://github.com/ajaxorg/cloud9.git

After Git checkout, enter the following command to install all the submodules and run the IDE:
bin/cloud9.sh

The editor will open in your default browser after all the submodules have been installed.

You can also install Cloud9 via NPM
npm install cloud9
or by downloading the source code from Github.
Review
Cloud9′s UI is similar to Eclipse IDE, so Eclipse…
If you are building a Django frontend for a legacy application chances are you will need to integrate your existing user database table(s) with the the Django authentication system (django.contrib.auth). In this tutorial we will look at writing our own authentication backend and plugging it into django.contrib.auth.
Getting Started
Authentication backends are pure python classes. Given a username and password, they are expected to validate them against an authentication source (such as a database) and return a User object. There is no requirement as to where the class is placed, however I always put it in the same directory as the application that handles registrations and logging in.
When a user logs in, Django will check the AUTHENTICATION_BACKENDS (tuple) setting and iterate through all backends until one returns true. The default authentication backend is django.contrib.auth.backends.ModelBackend.
Writing Our Backend
Our backend must have two methods: authenticate and get_user
authenticate takes two arguments – username and password. It is expected to return a User instance or None. The authenticate method should check the given username and password against the user table of the legacy application. If the credentials match, then create a new User instance, save it, and return it. If…
“MongoDB is a scalable, high-performance, open source, schema-free, document-oriented database. Written in C++” – www.mongodb.org (mongodb.org)
There has been alot of publiclity on NOSQL databases over the last few months. CouchDB, Cassandra and Redis are known to be highly scalable and blazingly fast, yet setup and adoption for hobby developers has been relatively low because there is no need for such high scalability and they are relatively difficulty to get setup.
MongoDB strikes a balance between the familiarity and ease of use of MySQL, and the freeness and performance offered by document storage databases. The database has no set schema so you can add, remove and modify the structure of your documents without having to issue an UPDATE statement.
Installation & Setup
Installing MongoDB is very easy. The only setup required is to create the directory that Mongo stores the data in. In Windows the default location is C:\data\db\ and on *nix it is /data/db/. Once the directory is created, download the appropriate Mongo binary from the downloads page (http://www.mongodb.org/display/DOCS/Downloads) and run the bin/mongod file. Mongo should now be up and running.

Now we need to install the PHP extension for MongoDB. If your on Linux or Mac OS…
Google translate is used by millions of people every day. Combine this with the easy reporting of language errors/mistakes makes it one of the most comprehensive and accurate online translators. Google provides an easy to use API to access their large language database, we’ll be using that today.
It will consist of two textareas, two dropdowns and one button. It will look something like this:

HTML
The HTML code is fairly straight foward. Notice the dropdown menus have values. These are essential as this is the language code, it’s sent to Google.
<body>
<div class="he">
<h2>Translate</h2>
From:
<select id="from">
<option value=sq>Albanian</option><option value=ar>Arabic</option><option value=bg>Bulgarian</option><option value=ca>Catalan</option><option value=zh-CN>Chinese (Simplified)</option><option value=zh-TW>Chinese (Traditional)</option><option value=hr>Croatian</option><option value=cs>Czech</option><option value=da>Danish</option><option value=nl>Dutch</option><option value=en selected>English</option><option value=et>Estonian</option><option value=tl>Filipino</option><option value=fi>Finnish</option><option value=fr>French</option><option value=gl>Galician</option><option value=de>German</option><option value=el>Greek</option><option value=iw>Hebrew</option><option value=hi>Hindi</option><option value=hu>Hungarian</option><option value=id>Indonesian</option><option value=it>Italian</option><option value=ja>Japanese</option><option value=ko>Korean</option><option value=lv>Latvian</option><option value=lt>Lithuanian</option><option value=mt>Maltese</option><option value=no>Norwegian</option><option value=pl>Polish</option><option value=pt>Portuguese</option><option value=ro>Romanian</option><option value=ru>Russian</option><option value=sr>Serbian</option><option value=sk>Slovak</option><option value=sl>Slovenian</option><option value=es>Spanish</option><option value=sv>Swedish</option><option value=th>Thai</option><option value=tr>Turkish</option><option value=uk>Ukrainian</option><option value=vi>Vietnamese</option>
</select>
To:
<select id="to">
<option value=sq>Albanian</option><option value=ar>Arabic</option><option value=bg>Bulgarian</option><option value=ca>Catalan</option><option value=zh-CN>Chinese (Simplified)</option><option value=zh-TW>Chinese (Traditional)</option><option value=hr>Croatian</option><option value=cs>Czech</option><option value=da>Danish</option><option value=nl>Dutch</option><option value=en selected>English</option><option value=et>Estonian</option><option value=tl>Filipino</option><option value=fi>Finnish</option><option value=fr>French</option><option value=gl>Galician</option><option value=de>German</option><option value=el>Greek</option><option value=iw>Hebrew</option><option value=hi>Hindi</option><option value=hu>Hungarian</option><option value=id>Indonesian</option><option value=it>Italian</option><option value=ja>Japanese</option><option value=ko>Korean</option><option value=lv>Latvian</option><option value=lt>Lithuanian</option><option value=mt>Maltese</option><option value=no>Norwegian</option><option value=pl>Polish</option><option value=pt>Portuguese</option><option value=ro>Romanian</option><option value=ru>Russian</option><option value=sr>Serbian</option><option value=sk>Slovak</option><option value=sl>Slovenian</option><option value=es>Spanish</option><option value=sv>Swedish</option><option value=th>Thai</option><option value=tr>Turkish</option><option value=uk>Ukrainian</option><option value=vi>Vietnamese</option>
</select>
</div>
<div class="tebg">
…
As we all know jQuery is a very small language. Not only is the file size of the jQuery library small, but the amount of code you need to write to achieve something is also very small. Because of this it is sometimes more efficient to write and test jQuery code in the browser than in a local file. To do this we need a couple of things.
- The Firebug Extension for Firefox
- Greasemonkey
If the page that we are going to manipulate doesn’t already include jQuery on it, then we can include it with this small Greasemonkey script. If jQuery is already included on the page, there is no use for this script.
// Add jQuery
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
// Check if jQuery's loaded
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; letsJQuery(); }
}
GM_wait();
// All your GM code must be inside this function
function letsJQuery() {
alert($); // check if the dollar (jquery) function works
}
Source
With the jQuery library on the page we can now go ahead and start entering commands. For this example we’ll take…
A stumbled across an amazing online app, meant to be like a CAD im guessing but then i realised the different things it could be used for. Project Draw gives you a grid to start off with, you can then place various shapes onto the grid and resize them. Further more you can add colours, text, gradients, alignments and borders which makes it a really good tool to design layouts.