Over the last few months I’ve found myself using the Vim text editor an increasing amount. Below are some resources that I found particularly useful.
Venturing Into Vim
Jeffery Way, editor and author of Nettuts, has released a 4 part video tutorial series called Learning Vim From The Ground Up. The 4 videos total over 2 hours playtime and cost just $5. They are recorded on Mac OS X at a screen resolution of 1280×720. Way’s experience in screencasting really shows in these videos. He clearly communicates all of his points, step by step, at a good speed. These videos start with the assumption you know absolutely nothing about Vim so they are a great resource for a Vim user of any level.
Vim Cheatsheet
The folks at ViEmu.com (who produce Vim keybindings for MS Office and Visual Studio) have produced a printable Vim cheatsheet. The cheatsheet clearly lays out the lower and upper case functionality for each key as well as some general Vim commands. The text size and colour contrast makes it easy to read from a distance, I recommend you print it out.

VimCasts.org
Drew Neil produces short, focused Vim screencasts and posts…
In the original Kohana wiki application the URLs in the views were hardcoded. If we wanted to change the domain name or restructure a route we would need to go through the application and change every single URL.
Thankfully the Kohana Route class comes with a method url() which allows us to generate URLs to routes we have specified in the application. In the first tutorial we defined the following routes in application/bootstrap.php:
Route::set('wiki-edit', 'wiki/<page>/edit')
->defaults(array(
'controller'=> 'wiki',
'action' => 'edit_page',
));
Route::set('wiki-save', 'wiki/<page>/save')
->defaults(array(
'controller'=> 'wiki',
'action' => 'save_page',
));
Route::set('wiki-page', 'wiki/<page>')
->defaults(array(
'controller'=> 'wiki',
'action' => 'view_page',
));
Route::set('default', 'wiki')
->defaults(array(
'controller' => 'wiki',
'action' => 'view_page',
'id' => 'index',
));
Before we can generate routes we need to set some configuration options in application/bootstrap.php (line ~82). We need to specify the base_url and index_file attributes in the array passed to Kohana::init(). The application on my local install is located at 127.0.0.1/query7kwiki/index.php, so my Kohana::init() statement would read:
Kohana::init(array(
'base_url' => '/query7kwiki/',
'index_file' => 'index.php'
));
In application/views/edit.php the form action attribute was hardcoded to the value /query7kwiki/index.php/wiki/. That can be replaced by:
<?php echo Route::url('wiki-save', array('page' => $page)); ?>
In application/views/single.php there is a…
In this tutorial you will learn how to create a simple wiki using the PHP framework Kohana version 3.1. Several years ago Siddharta Govindaraj created a screencast demonstrating how to create a wiki using Django, this is essentially the Kohana version of that. It covers using Kohana’s Routing, ORM and MVC systems. Full source code of the application is available on github.
The wiki application has 3 different pages:
- /wiki/somepage/save – handles the saving of the page
- /wiki/somepage/edit – displays a form that allows the user to edit the page
- /wiki/somepage – displays the page
Configuration
We will be using the ORM module to query the database for our wiki pages so we must load it in the application/bootstrap.php file (Line ~99).
Kohana::modules(array(
'database' => MODPATH.'database', // Database access
'orm' => MODPATH.'orm', // Object Relationship Mapping
));
We also need to specify our database configuration settings. This is done in application/config/database.php.
<?php
return array
(
'default' => array
(
'type' => 'mysql',
'connection' => array(
'hostname' => '127.0.0.1',
'username' => 'root',
'password' => 'root',
'persistent' => FALSE,
'database' => 'query7kwiki',
),
'table_prefix' => '',
'charset' => 'utf8',
'caching' => FALSE,
'profiling' => TRUE,
),
);
…
Dojo is an open source Javascript toolkit. It provides an easy way to access and modify the DOM as well as a rich user interface widget library. One of the most powerful widgets in the Dojo toolkit is DataGrid. It provides an easy way to represent what is essentially a cross between a spreadsheet and a table. In a recent Django project I needed to output the contents of a model into the DataGrid. Thanks to django-dojoserializer this is very easy.
Setup
We need the Python package django-dojoserializer. This can be installed by downloading the source and running
python setup.py install
or with setuptools using
easy_install django-dojoserializer
or with pip using
pip install django-dojoserializer
Then add django-dojoserializer to the INSTALLED_APPS tuple in settings.py.
Dojo will need to be linked correctly in the Django template. We need to require the dojox.grid.DataGrid and dojo.data.ItemFileReadStore classes.
<script src="/static/libs/dojo/dojo.js" djConfig="parseOnLoad: true">%lt;/script>
<script type="text/javascript">
dojo.require('dojox.grid.DataGrid');
dojo.require('dojo.data.ItemFileReadStore');
</script>
Django Model
PROXY_TYPE_CHOICES = (
('SOCKS4', 'SOCKS4'),
('SOCKS5', 'SOCKS5'),
('HTTP', 'HTTP'),
)
class Proxy(models.Model):
ip = models.CharField(max_length=50)
type = models.CharField(max_length=6, choices=PROXY_TYPE_CHOICES)
alive = models.BooleanField(default=False)
added = models.DateTimeField(auto_now=False, auto_now_add=True)
last_checked = models.DateTimeField(auto_now=True, auto_now_add=False)
def __unicode__(self):
return self.ip
Django View
The view needs…
NodeJS is a powerful evented Javascript platform running on top of Google’s V8 javascript engine. Over the last year the popularity of NodeJS has increased greatly, as shown by the number of discussions on programming forums such as Hacker News, Reddit and Stackoverflow. Despite this NodeJS is still young and it falls short to Python and Ruby when it comes to the number and range of libraries and modules available.
The Problem
I wanted to convert one of my web scraping applications I made in PHP to NodeJS. The application interacts with SOCKS4 and SOCKS5 proxies using PHP’s cURL bindings. Unfortunately there are no cURL bindings (or SOCKS protocol wrappers) written for NodeJS. NodeJS does come with an HTTP client module that can issue web requests, however it doesn’t support SOCKS proxies.
The Solution
Although there are no specific NodeJS bindings for cURL, we can still issue cURL requests via the command line interface. NodeJS comes with the child_process module which easily allows us to start processes and read their output. Doing so is fairly straight forward. We just need to import the exec method from the child_process module and call it. The first parameter is the command…
In this series of tutorials we use Appcelerator’s Titanium Mobile platform to create Android applications. This tutorial walks you through developing and packaging your first Titanium application. Full source and packaged application is available on github.
I’ve been writing programs in Python for the past 3 years and I must accept that I am a big fan of its no-nonsense approach towards programming and it’s clean and easy to understand syntax. It was recently chosen as the
best programming and scripting language by Linux Developers and is also considered as the
Holy Grail of programming by CERN. It is perhaps the
best language for beginners as it lets you focus on programming without worrying much about syntax.
Today, Python is being extensively used at Google, Yahoo, CERN, NASA and ITA. It has been successfully embedded in a number of software products as a scripting language including Maya,MotionBuilder, SoftImage, Cinema4D, Blender, GIMP and Paint Shop Pro. Python has also been actively used for writing web applications. Some of the most sophisticated Python web frameworks include Django, Pylons, TurboGears and Web2Py.
In this article, I’ll provide you some resources, which will help you get started with Python:
Google Code: Getting Started – Python
Python Programming Tutorials
A Gentle Introduction to Programming Using Python
Dive Into Python
How to think like a computer scientist – Learning with Python
I hope these resources
…
Automate fetching Wikipedia descriptions and images for webpage content. Render content dynamically based on specific keywords.
Google’s Blogger is the eighth most popular site on the entire Web today, and by far the most popular free blogging site. According to Google, Blogger now hosts over 300 million blogs and publishes 388 million words per day – simply staggering figures. Let’s look at some of the more compelling reasons for Blogger’s popularity.

Lots of compatibility issues occur when HTML developers deal with HTML-formatted emails generated using server side languages like PHP, PERL, JAVA, etc. in their projects.
From time to time you’ll find the odd gobbledygooked message in your Web-based email app, but generally speaking HTML-formatted messages render flawlessly on the Web. On the other hand, desktop mail clients such as Outlook on Windows, Mail.app on OS X, and the rainbow flavors of desktop Linux (Ubuntu, Centos, and so on) routinely have rendering issues with HTML-based email.
Despite the incredible advances in modern software, why does this continue to happen?
The answer is quite simple: certain mail clients ignore certain HTML tags. Now there’s no universal rule as to which ignores what, but the more you code the more you’ll learn, so for now let’s take a look at one case with Outlook.
For many users, email ‘stationery’ conjures up late 90s memories of Incredimail and a general, unsavory n00bishness. But for marketing purposes a well-designed mail template, consisting of a stylish background image, thoughtful font selection, layout and copy equates to sales. Perhaps thousands of people – from prospective clients to the media – will view mail…