24 Jan 2010

Windows God Mode

This handy little folder makes access all system settings a breeze. The control panel can get a little annoying sometimes, so to avoid this and point everything in one location just create a new folder on your desktop, then rename it with the following:

Everything.{ED7BA470-8E54-465E-825C-99712043E01C}

“Everything” can actually be anything you want to name the folder. Once you hit enter on the rename the folder name will change.

30 Oct 2009

Apache Virtual Hosts (XAMPP)

apache

I had to create a couple virtual hosts on a windows 7 machine running XAMPP for development purposes.  This is typically a simple task.  XAMPP has an Apache virtual host configuration file in <xampp installation>\apache\conf\extra\httpd-vhosts.conf

There are some basic containers already set that you can use as reference, but in the end you have something like this:

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
	DocumentRoot D:/www
	ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
	DocumentRoot D:/www/mysite
	ServerName mysite.dev
</VirtualHost>

You then just configure your hosts file to point to your local IP address:

127.0.0.1    localhost
127.0.0.1    mysite.dev

You can add more directives to the virtualhost, but this was just the basic setup to get urls working without having to use subdirectories like http://localhost/mysite. Instead, I can use http://mysite.dev.

Restart apache and everything should be golden, but no, never quite that easy. I kept getting a blank screen for mysite.dev, but localhost was working. I would ping mysite.dev and get 127.0.0.1 like I would expect.

Well, long story short, I’ve behind a proxy/firewall and didn’t tell my browser to ignore the .dev domain. So, for my own purpose when I forget this again in a year or so, or anyone else behind a corporate network that may have a similar issue, this was why.

26 Oct 2009

Wordpress Widgets

wordpress

Wordpress widgets allow you to dynamically add content to sidebars directly from the wordpress control panel. I think this is a great option. The reason I’m using a Blog CMS is to reduce the amount of code I have to write, so this means less markup in my theme. I’m using only one sidebar on this site with a few widgets, including search, categories and links.

There are a few tricks to get widgets to work how you want, but it is relatively quick and painless. I’ll give an example of how I made this theme widget ready.

Read the rest of this entry »

15 Oct 2009

Filemaker searching with custom dialog and variables

filemaker

The built in scripting engine for FilemakerPro is actually pretty decent, but people design some pretty clunky interfaces. What I wanted was a button that the user could click which would open a dialog box with some search field inputs. There are a few tricks to get this to work properly.

The first step is to open the scripting engine. This is found under “Scripts” > “ScriptMaker”. Click on “New” in the dialog window to create a new script. The dialog window allows you to use up to 3 fields. Why you can’t select more is beyond me, but that is fine for my purpose.

Read the rest of this entry »

15 Oct 2009

CakePHP Auth Component Problem

cakephp

I’ve been using CakePHP for my last few projects and recently ran into a problem that was driving me nuts.  I have a few pages that don’t require any authentication.  You can allow pages to be viewed by calling $this->Auth->allow(’function_name’) in your beforeFilter() method.  So, I set up my app_controller class with a before filter that looks something like this.

< ?php

class AppController extends Controller {

    var $helpers = array('Html', 'Form', 'Javascript');
    var $components = array('Auth');

    function beforeFilter() {
        $this->Auth->autoRedirect = false;
        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
        $this->Auth->allow('display');
    }

}

?>

Read the rest of this entry »

13 Oct 2009

Hello world!

If you are seeing this it is because I’m trying to create this site pretty much in real time.  I started creating this minimalistic theme and decided I’d upload changes as I go rather than only testing from my development machine.  This theme will have nothing very fancy, but I do plan to actually start blogging about things I do as an IT Pro and Web Developer.  Hopefully the majority of this blog will be completed over the next week or two.