Fixing Gmail outgoing server (offline) issue in Mac Mail

Posted by on Jul 4, 2013 in how to | No Comments

In Mac mail, my Gmail accounts outgoing server “Gmail” was constantly offline. This last page of this article: How to Access a Gmail Account in Mac OS X Mail did the trick for me. I needed to switch the outgoing server port setting to 465.

Python tip, list contents of directory

Posted by on Aug 3, 2011 in how to, python | No Comments

Python: list contents of a directory, remove an extension from the file names.

import os
for fname in dirList:
    print fname.replace('.ext','')

How to subtitle in After Effects

Posted by on May 5, 2011 in After Effects, code, how to | One Comment

To subtitle in After effects, use the script linked below.

	//	Subtitle generator by !Rocky
	//	modified by Colin Harman ( ) to work on a Mac
	//     modified by Oliver to work with CS5
	//	Save this code as
	//	"subtitles.jsx"
	//	Create a text file with your subtitles.
	//	Each line of text is one on-screen line.
	//	To have several lines on-screen at the same time,
	//	simply separate them with a pipe ( | ) character.
	//	eg "Character 1 talks|Character 2 interrupts"
	//	Create a new text layer in your comp, adjust its position,
	//	make sure the text's centered, so it looks nice
	//	Add markers (Numpad *) where each subtitle line must be shown/hidden.
	//	With the text layer selected, run the script, and select the subtitles file.
	//	Enjoy!

	function makeSubs() {
		var layer = app.project.activeItem.selectedLayers[0];

		if ("sourceText") != null) {
			var textFile = File.openDialog("Select a text file to open.", "");
			if (textFile != null) {
				var textLines = new Array();"r", "TEXT", "????");

				while (!textFile.eof)
					textLines[textLines.length] = textFile.readln();


				var sourceText ="sourceText");
				var markers ="marker");

				for (var i = sourceText.numKeys; i >= 1; i--)

				var line = 0;
				var subTime, subText;
				for (var i = 1; i <= markers.numKeys; i++) {
					subTime = markers.keyTime(i);
					sourceText.setValueAtTime(0, " ");

					if ((i % 2) == 0) {
						subText = " ";
					else {
						subText = textLines[line].replace("|", "\x0d\x0a");
					sourceText.setValueAtTime(subTime, new TextDocument(subText));

PHP, handling forms

Posted by on Jan 26, 2011 in code, how to, web | No Comments

HTML form, which calls a seperate php file, called action.php:

<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>

The contents of action.php:

Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old.

Your name:

Your age:


From: A simple tutorial

Add a Pay Pal “Buy Now” Button

Posted by on Jan 25, 2011 in code, how to | No Comments

If you have a PayPal account, go here to set up Buy Now, Cart, Donate buttons.


OK, now give me a dollar!



OK, a penny?

How to exclude categories from sidebar

Posted by on Jan 13, 2011 in how to | No Comments

<?php wp_list_categories(‘exclude=3,4,6,7,10,11,12,20,109&title_li=<h2>Categories</h2>’); ?>

HTML create new line

Posted by on Jan 11, 2011 in code, how to, web, wordpress | No Comments

To create white space between paragraphs in a post etc in WordPress.

<br />&nbsp;

How to create a mouse-over image for a wordpress post

Posted by on Jan 11, 2011 in code, how to | No Comments

This comes from a nice tutorial that you can find here at: More Than A Maths Teacher.

You will need to add a javascript file to the root folder of your current wordpress theme. Code is below. Note the the images I used for the mouse-over are named image.png and image_over.png. For this particular script to work, your images must be names image.png and image_over.png ( “image” stands for whatever you want, and can be replaced). If you want to use another file format, than png, you must edit the code.

jQuery(function($) {
$(document).ready(function() {

		// Preload all rollovers
		$(".hoverlink img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.png$/ig,"_over.png");
			$("<img>").attr("src", rollON);

		// Navigation rollovers
		$(".hoverlink a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);

			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.png$/ig,"_over.png"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);

		$(".hoverlink a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);


Nextyou will need to add the following code to your head.php file, somewhere between the tags.

       wp_enqueue_script('hoverlink', get_bloginfo('template_directory').'/rollover.js');

Finally use this format to the post to add the images:

<div class="hoverlink">
<a href=""><img src="" border="0" alt="mouse-over" width="200" height="100" /></a></div>

How to learn PHP

Posted by on Jan 5, 2011 in code, how to | No Comments

1. Download and install XAMPP (free). You will need to run this software (or similar) to enable an Apache web server on your computer. In other words you need this to run PHP scripts.
2. Download and install Eclipse PDT All In Ones / Eclipse PHP Package (free). This is a development environment, a text editor and other tools, with which to create your PHP scripts.
3. Launch XAMPP. Start Apache, and MySQL.
4. Launch Eclipse. You will need to choose the “workspace”. The workspace is where you will save your php files. Generally you will want to use XAMPP’s htdocs folder. Found in the application folder where XAMPP resides. While XAMPP is running you will be able to launch your php scripts in a web browser by navigating to http://localhost/myScript.php
4. Find a book or tutorials. Start learning.

Load More