Disabling TextMate’s auto-open of previous projects

March 26, 2011

defaults write -app TextMate OakDisableSessionRestore 1

Comments Off on Disabling TextMate’s auto-open of previous projects

Quickie: Running a Controller action from a script in LightVC

September 29, 2010

Create scripts/test_action.php in your LVC app:
http://pastie.org/1190014

Excitin’.

Just be aware you’re running things from the command line, and the usual caveats with respect to running PHP CLI apply (superglobals, etc).

Comments Off on Quickie: Running a Controller action from a script in LightVC

Mass-op plugin for Colloquy

August 29, 2010

There’s no massop command in Colloquy, so here’s a javascript plugin that does it.

Copy/paste the following as whatever.js in your ~/Application Support/Colloquy/PlugIns/ directory:

function opNick(nick, connection, view)
{
	connection.sendRawMessage("MODE " + view.target() + " +o " + nick);
}
 
function massOp(connection, view)
{
	var members = view.chatMembers();
	var len = members.length;
 
	for (var i = 0; i < len; i++)
	{
		if (!members[i].operator())
		{
			opNick(members[i].nickname(), connection, view);
		}
	}
	return false;
 
}
 
// process the command and return true if you handle it or false to pass on to another plugin
function processUserCommand( command, arguments, connection, view ) {
	// return true if the command was handled or to prevent other plugins or Colloquy from handling it
	if (command == 'mop')
	{
		massOp(connection, view);
		return true;
	}
	return false;
}
2

mysqli driver, prepared statements and geometry types

August 23, 2010

FYI:

PHP Warning: mysqli_stmt_bind_result(): Server returned unknown type 255. Probably your client library is incompatible with the server version you use!


Probably means you’re selecting a geometry type without calling AsText on it.
Instead of

SELECT
	place.location_point
FROM
	place
WHERE
	place.place_id = ?

do:

SELECT
	AsText(place.location_point)
FROM
	place
WHERE
	place.place_id

Supposedly this is fixed in PHP 5.3. That isn’t really useful information, nor is the snotty svn commit message to use mysqlnd.

See: http://www.mail-archive.com/php-bugs@lists.php.net/msg127837.html

Comments Off on mysqli driver, prepared statements and geometry types

A little TextMate black magic

August 19, 2010

I do most of my code editing in TextMate in OSX.

However my current code environment consists of a CentOS VM running under parallels.

I have my linux home directory mounted via SMB in OSX, but I like to do a lot of poking around on the files from the shell on the VM.

So, here’s a shell script to let me open files in TextMate from the VM:

#!/bin/tcsh
set f="`pwd`/$*"
set f="$f:s./home/pistole./Volumes/pistole/."
ssh wrath open -a /Applications/TextMate.app "$f"
Comments Off on A little TextMate black magic

Tutorial: Controllers and Actions in LightVC

August 25, 2009
Tags: ,

In this tutorial, we continue to create an MVC application using the bare LightVC and CoughPHP distributions, focusing on Controllers and Views in LighVC.

For this tutorial, you will need to have the skeleton application created in the previous article on combining CoughPHP and LightVC, as well as our database table and generated CoughPHP code.
(more…)

5

Hashing Axapta 3 compatible passwords from PHP

August 21, 2009
Tags: ,

As an interlude from the CoughPHP, I present the following:

The downside of working with legacy systems is that sometimes you find it necessary to work with existing data in ways that are completely arbitrary. The worst of all of these is password hashing.

(more…)

1

Creating Cough models for our CoughPHP/LightVC application

April 10, 2009
Tags: ,

In this tutorial, we continue to create an MVC application using the bare LightVC and CoughPHP distributions, focusing on creating working cough model classes and using them in the application, as well as best practices for different deployment environment files for LightVC applications, CoughPHP generation config, and suggested db schema patterns.

For this tutorial, you will need to have the skeleton application created in the previous article on combining CoughPHP and LightVC, as well as a working installation of MySQL. Installing and configuring MySQL is outside the scope of this tutorial, but there are many pre-packaged versions available.
(more…)

12

Combining CoughPHP and LightVC

February 16, 2009
Tags: ,

In this tutorial, we will be creating an MVC application using the bare LightVC and CoughPHP distributions.
(more…)

6

Welcome to blog.rhp.org

February 15, 2009
Tags: ,

Welcome to my personal blog, blog.rhp.org. This blog will be kept updated with my musings on technology, programming tutorials and other randomness.

First up will be a series of articles detailing how to make a simple content management system in PHP using LightVC and CoughPHP, lightweight VC and ORM frameworks the combine to create a simple and powerful MVC solution.

1