jonnay's blog

Kallooo Kallay! PHP has Anonymous Functions!

I can't believe I didn't notice PHP has Anonymous Functions and Closures!

Once they have functions as first class objects, then there is a chance that it will stop sucking!

Embed Test

11 favourite words in the english language

I have been (re)reading "Sex, Drugs, Einstein and Elves" by Clifford Pickover. Awesome book. In one of the chapters is a list of various authors' favorite words, so I thought I would come up with my own.

Presenting: the 11 favorite words of Jonnay

  • Vaudeville
  • Pitching woo
  • Sacrosanct
  • Deluge
  • Salsa
  • Confabulation
  • Vernacular
  • Milieu
  • Remiss
  • Recalcitrant
  • Resplendent

Using Boost with Drupal. Performance goooodnes

Having successfully deploying a reasonably high traffic Drupal website, I can tell you that the boost module is like mana from heaven.

The only issue that I have found with the boost module is when you have blocks that update data in real time, or are interactive, a good example being the poll module. This can be over-come by writing a custom module that pulls in the content via AJAX. This isn't particularly difficult to do. I bet that it could be fairly easily generalized, and if I had mounds of spare time, I would do exactly that.

Importing a drupal view programmatically

If you need to import a drupal view programmatically, it is fairly simple:

	include_once(drupal_get_path('module', 'views') .'/views.module');
	include_once(drupal_get_path('module', 'views') .'/includes/view.inc');
	include_once(drupal_get_path('module', 'views') .'/includes/cache.inc') ;
	include_once(drupal_get_path('module', 'views') .'/includes/convert.inc'); 

        /* ... insert import code here */

	views1_import($view);

	$view->save();
Read more

SimpleXML Vs. SXML

I had a chance to really play with PHPs native XML support.

It's interesting, but a little leaky in its abstraction. I had to futz around with the options to make it recognize CDATA sections, which involved passing options to libxml.

$xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);

Additionally, trying to serialize and unserialize SimpleXML objects is a dirty, hacky job. I didn't even bother trying to tackle that (though others have). In Short, native support for xml, isn't quite native inside of PHP.

Read more

Emacs Tramp Hangs on Mac OS X when doing a sudo

in

I just found this bit of weirdness, and I am not necessarily the only one either.

Whenever using Tramp to open a file with the /sudo::/ syntax, it would hang for a long time. Sometimes not even being responsive to Ctrl-G. Looking at the process tree, I noticed that there was a stuck ping process.

This seemed to be because of the ecb-ping-options variable. It was set to

("HOST")

If that is switched to

("-c 2" "HOST")

instead, then everything should work.

Read more

Tattoo

Tattoo

Here is the tattoo I got on Thursday.

It itches right now, and is peeling. It took about an hour to do, I designed it, and it was expertly inked by Vince at Tiki Town [facebook fan page] [map]

Another Bunny Animation, this time for my lovely wife!

IHeartShell

Another Funky Animation... (click on "read more")

Read more

Emacs, Windows, and SSH

in

One of the biggest bees in my bonnet with Emacs on win32 was the fact that I couldn't really get cygwin ssh to play nice with it. It would always complain about an inappropriate ioctl device or some such.

The fix? Use Plink, part of the PuTTY suite (download download plink here).

Here is a little function to make it go. If you need to log in with a different user name, just use the user@ syntax.

(require 'telnet)

Read more
Syndicate content