1 Dec 2010

fruit


fruit, originally uploaded by leo_p.
Testing the link between Flickr and Blogger.
If you want to link your Flickr and Blogger accounts watch this video: http://www.flickr.com/photos/ivanwalsh/3504011106/
You can choose whether you share a photo - it doesn't automatically share everything.

<pre> and <code> in blogger blogs

It seems that the best way to post code in a blogger blog is by encoding the chevrons '<>' and ampersands '&' using something like http://centricle.com/tools/html-entities/

Some styles are needed in the template and you have to wrap the code up in <pre>...</pre> or <code>...</code>

The Coldfusion Blog Tutorial

There may well be one out there, but I didn't look too hard.

Today, snowbound at home, I am adapting the CakePHP blog tutorial to Coldfusion. The only difficulties will be that cakePHP & MVC makes a lot of things very easy, but doing it in CF is going to be very 'hands on'. At least I'll get a lot of low-down experience with CF.

If it proves to be interesting or useful and if I have the time or the inclination, I may well publish it for the benefit of other CF newcomers.

30 Nov 2010

Mac OSX VPN to Windows 7

Forced home by snow and impending more snow I had to set up VPN access from my Hac to my Windows 7 workstation. Fortunately the VPN server end is already set up.

Doing the Mac setup was pretty trivial. Go to network settings in system preferences. Add a new connection using the + sign at the bottom left. Then just follow through the settings. It's really not that difficult. If you're a bit dim, there's a picture guide here: http://bit.ly/do_vpn_on_mac

Of course, you also need some sort of remote desktop app. The first one I found was CoRD (http://cord.sourceforge.net/) which seemed a bit tricky to set up, and says it doesn't use Mac VPN, but it doesn't work without a VPN connection. Anyway, it's pretty slick and FREE. The second one was Microsoft Remote Desktop Connection for Mac 2, which is included with every edition of Office for Mac 2011 (if you're fool enough to buy it or use it). Well, it's also a FREE download (http://www.microsoft.com/mac/remote-desktop-client) and, surprisingly, it works.

They both work well but, politics aside, I don't know which one I'll use. I've only had half a day to try them out.

Coldfusion

It's been a while since I wrote anything, but that doesn't mean I haven't done anything. I've been head down wrapping up a CakePHP CMS before I changed jobs. Now I'm a Coldfusion developer. WTF? I've never used it but working through the tutorials it seems really straightforward. I guess the hard part will be letting go of MVC. Of course, someone has cooked up an MVC framework for CF, but there's too much legacy in my new job to even think about it.

I'll still be doing the CakePHP stuff as well as I have one or two personal projects and, for a smalltimer, hosting Coldfusion is just too expensive.

30 Jul 2010

Basic .htaccess Modifications

This is a useful .htaccess for a basic CakePhp website. It enables
compression, normalises URLs by removing 'www' and then moves on to the
standard CakePhp redirection:
# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css 
text/javascript
<IfModule mod_rewrite.c>
RewriteEngine on
# Convert all http://www.example.com style URLs to http://example.com
RewriteCond %{HTTP_HOST} ^www\.(.+)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>
In certain situations - in this case our CMS - this substitution might 
be useful:
#RewriteRule    ^$ app/webroot/    [L]
RewriteRule    ^$ my-anchor-page    [L]

29 Jul 2010

INSERT rows with SELECT & mixed data

To extract values from one table, to update another where you also need
to supplement the data - in this case
(`module_type_id`,`module_id`,`zone_id`,`position`) are static
(12,42,12,1) - include the supplementary values in the SELECT statement:

INSERT page_items 
(`node_descriptor_id`,`module_type_id`,`module_id`,`zone_id`,`position`)
SELECT id ,12,42,12,1 FROM node_descriptors