<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cakealot &#187; General</title>
	<atom:link href="http://cakealot.com/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakealot.com</link>
	<description>cakephp and stuff</description>
	<lastBuildDate>Sat, 13 Mar 2010 23:20:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Coda Plugin: PHP Getter/Setter</title>
		<link>http://cakealot.com/2009/08/coda-plugin-php-gettersetter/</link>
		<comments>http://cakealot.com/2009/08/coda-plugin-php-gettersetter/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 13:55:12 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[coda]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=459</guid>
		<description><![CDATA[Wrote a plugin for the Coda (Mac) to easily generate common get/set methods for PHP class variables. Download included in this post.]]></description>
			<content:encoded><![CDATA[<p>After being busy busy busy i had some time to write a little plugin for <a href="http://www.panic.com/coda/"><strong>Coda</strong> by Panic</a> which i felt missing for those of us writing PHP classes all day long. </p>
<p><strong>Getter/Setter</strong> is inspired by the function that is included in <strong>Zend Studio for Eclipse</strong> and creates public <code>getVariable</code> and <code>setVariable</code> methods from the member variables you select. </p>
<p>Here&#8217;s a example class:</p>
<pre class="sh_php">
class SomeClass extends SomeOtherClass {

	public $name = 'SomeClass';

	protected $_my_integer = 0;

	protected $_my_boolean = false;

	protected $_my_constant = THIS_IS_MY_CONST;

	private $__someEmptyString = "";

	// this is a $test
	static public $prop;
}
</pre>
<p>You simply select a bunch of member variables (like those above) in your class and hit the command <strong>CTRL + SHIFT + S</strong> (i know, probably there are better ones) to insert the methods. </p>
<p>Example output with just <code>public $name</code> selected:</p>
<pre class="sh_php">
	/**
	 * Get value of $this->name
	 *
	 * @access public
	 * @return string
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * Set the value of $this->name
	 *
	 * @param string $value
	 * @access public
	 */
	public function setName($value) {
		$this->name = $value;
	}
</pre>
<p>There is some <strong>type detection</strong> in place for the PHPDoc tags aswell as recognition of <code>static</code> variables. </p>
<p>If i do the same command with <code>protected $_my_integer</code>:</p>
<pre class="sh_php">
	/**
	 * Get value of $this->_my_integer
	 *
	 * @access public
	 * @return integer
	 */
</pre>
<p>The return type is now &#8220;integer&#8221; as expected, since that&#8217;s the default value for this member variable.</p>
<p>For <strong>static variables</strong> the assignement is changed from <code>$this</code> to <code>self::</code> and the methods also get a static flag in front of them.</p>
<pre class="sh_php">
	/**
	 * Get value of self::$prop
	 *
	 * @access public
	 * @return mixed
	 */
	static public function getProp() {
		return self::$prop;
	}

	/**
	 * Set the value of self::$prop
	 *
	 * @param mixed $value
	 * @access public
	 */
	static public function setProp($value) {
		self::$prop = $value;
	}
</pre>
<p>It works with single lines, aswell with multiple of course. Default values that are constants are always typed &#8220;mixed&#8221; as i find that definiton appropiate. Constants may contain string, bool, int.. so best guess is mixed. Also &#8220;null&#8221; is treated as &#8220;mixed&#8221; since it&#8217;s .. yeah.. null.</p>
<p>Of course there is some odd behavior which i couldn&#8217;t prevent but given the benefit you have these are acceptable.</p>
<p><strong>Known Issues:</strong></p>
<ul>
<li>Code is generated directly after the selected lines. Not at the end of the class or anywhere else fancy. This kinda sucks, but a quick copy paste after insertion will do.. There is no way for me to discover the code level (closing brace, etc.) and the Coda API doesn&#8217;t tell either.</li>
<li>If you double click a member variable the semicolon is not selected (Coda issue/feature). Since the plugin outputs directly after what has been selected the semicolon is pushed down (after the generated methods). Prevent this by selecting the whole line, or include semicolon.</li>
</ul>
<p>I think it&#8217;s cool anyhow and maybe i get a hang on it and publish some more plugins geared towards CakePHP. </p>
<div><strong>I hope you enjoy this little helper plugin!</strong><br/><br />
<a href="http://static.cakealot.com/wp-content/uploads/2009/08/PHPGetterSetter.codaplugin.zip" style="text-decoration:none;display:block;float:left;margin-right:10px;text-align:center"><img src="http://cakealot.com/wp-includes/images/crystal/archive.png" alt="Download ZIP Archive" style="border:0" /><br />Download</a>With Coda installed the plugin should add and activate itself after you double click the package. If not, you can place it in <code>~/Library/Application Support/Coda/Plug-Ins/</code>. To uninstall just delete the package and restart Coda. If you want to have another shortcut just create one using MacOSX Shortcut Menu in your System Preference Panel.<br />
<br style="clear:both"/>
</div>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/08/coda-plugin-php-gettersetter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Check ma sprockets!</title>
		<link>http://cakealot.com/2009/05/check-ma-sprockets/</link>
		<comments>http://cakealot.com/2009/05/check-ma-sprockets/#comments</comments>
		<pubDate>Sun, 17 May 2009 21:39:49 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Assets]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[minification]]></category>
		<category><![CDATA[sprockets]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=390</guid>
		<description><![CDATA[Ever since i heard of Sprockets on Twitter i wanted to use it in my apps. Unfortunatly i am not into Ruby.
Sprockets is a Ruby library that preprocesses and concatenates JavaScript source files. It takes any number of source files and preprocesses them line-by-line in order to build a single concatenation. &#8211; getsprockets.org
I wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since i heard of Sprockets on Twitter i wanted to use it in my apps. Unfortunatly i am not into Ruby.</p>
<blockquote><p>Sprockets is a Ruby library that preprocesses and concatenates JavaScript source files. It takes any number of source files and preprocesses them line-by-line in order to build a single concatenation. &#8211; <a href="http://www.getsprockets.org/">getsprockets.org</a></p></blockquote>
<p>I wanted to port it to PHP or find clever ways to use it in CakePHP (shell?). But before you start something like this you should check if there isn&#8217;t already a project and so i found <a href="http://github.com/stuartloxton/php-sprockets">PHPSprockets from Stuart Loxton</a>. PHP Sprocket is a port of Sprockets. Cool.. so the meat of sprockets is already available :)</p>
<blockquote><p>PHP Sprockets currently acts as a transparent proxy as default and caches results. Because of this you do not have to initialize any classes in your app and sprocket stays separate.</p></blockquote>
<p>Thanks to GitHub i just <a href="http://github.com/m3nt0r/php-sprockets/">forked the project</a> and began pimping Stuarts class.<br />
Here are the major differences from the orignal port:</p>
<ul>
<li>The main class file has been renamed to “Sprocket” </li>
<li>Commands are now classes. It is easy to extend Sprocket with new commands.</li>
<li>Instead of <span class="caps">YML</span> this fork uses <span class="caps">INI</span> files for providing constants.</li>
<li>Easy to extend due more abstraction, setters and a array based option interface</li>
<li>Seperate render stage (with autoRender option to mimic the original render-on-construct).</li>
<li>Also works with other files, like <span class="caps">CSS</span> and whatever you want to concat.. (see demo)</li>
<li>Selective minification for JS and <span class="caps">CSS</span> out of the box. Just add “minify” (see demo files)</li>
<li>Fully documented sourcecode</li>
</ul>
<p>I also added a demo and there is more info about my rewrite in the repo readme.<br />
Enjoy! &#8211; <a href="http://github.com/m3nt0r/php-sprockets">http://github.com/m3nt0r/php-sprockets</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/05/check-ma-sprockets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing missing ssh-askpass on MacOS 10.5</title>
		<link>http://cakealot.com/2009/04/fixing-missing-ssh-askpass-on-macos-105/</link>
		<comments>http://cakealot.com/2009/04/fixing-missing-ssh-askpass-on-macos-105/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:46:00 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macintosh]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=369</guid>
		<description><![CDATA[This helps if you have trouble with missing <code>/usr/libexec/ssh-askpass</code> on Leopard. It's quiet annoying but i found the following shell script and it works perfect for Textmate and probably all other places. This includes not just passwords but also the yes/no for the remote fingerprint question. ]]></description>
			<content:encoded><![CDATA[<p>This helps if you have trouble with missing <code>/usr/libexec/ssh-askpass</code> on Leopard. It&#8217;s quiet annoying but i found the following shell script and it works perfect for Textmate and probably all other places. This includes not just passwords but also the yes/no for the remote fingerprint question. </p>
<pre><code>#! /bin/sh
#
# An SSH_ASKPASS command for MacOS X
#
# Author: Joseph Mocker, Sun Microsystems
#
# To use this script:
#     setenv SSH_ASKPASS "macos-askpass"
#     setenv DISPLAY ":0"
#
TITLE=${MACOS_ASKPASS_TITLE:-"SSH"}

DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
DIALOG="$DIALOG with icon caution with hidden answer"

result=`osascript -e 'tell application "Finder"' -e "activate"  -e "$DIALOG" -e 'end tell'`

if [ "$result" = "" ]; then
    exit 1
else
    echo "$result" | sed -e 's/^text returned://' -e 's/, button returned:.*$//'
    exit 0
fi</code></pre>
<p>That&#8217;s the original script <a href="http://www.retep.org/2009/04/ssh-askpass-on-osx-105.html" title="Source">found on Retep&#8217;s Open Source Blog</a>. I&#8217;ve reposted the script here because it was poorly formatted (quotes) and there is one thing to change.<br />
<span id="more-369"></span></p>
<p>Save the above as <strong>ssh-askpass</strong>:</p>
<pre>sudo vi /usr/libexec/ssh-askpass</pre>
<p>Paste the script, save the file (needs sudo password), make it executable</p>
<pre>sudo chmod +x /usr/libexec/ssh-askpass</pre>
<p>The <code>setenv</code> didn&#8217;t work on my 10.5.0 install. So instead, i had to  use &#8220;export&#8221;:</p>
<pre><code>export SSH_ASKPASS="macos-askpass"
export DISPLAY=":0"</code></pre>
<p>Now i pushed current branch in textmate and it worked right away. Great! :)<br />
<img src="http://static.cakealot.com/wp-content/uploads/2009/04/ssh_askpass_screen.png" style="padding-top:1em" alt="ssh_askpass_screen" title="ssh_askpass_screen" width="567" height="395" class="alignnone size-full wp-image-377" /></p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/04/fixing-missing-ssh-askpass-on-macos-105/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cakealot.com redesign</title>
		<link>http://cakealot.com/2009/02/cakealotcom-redesign/</link>
		<comments>http://cakealot.com/2009/02/cakealotcom-redesign/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 08:59:41 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=240</guid>
		<description><![CDATA[Redesigned the blog. say what?! :-)]]></description>
			<content:encoded><![CDATA[<p>Woke up way early this morning and so happen to be kinda in the mood to actually come up with a original design for this blog. It&#8217;s a little darker than before and pretty easy on the eyes. The layout is supported by YUI Grids/Fonts and looks good in FF and Safari. I didn&#8217;t experiment too much in regard of CSS and my guess is that it will look &#8220;okay&#8221; on all browsers. If you have access to IE please verify and let me know. The last two months my computers died one after another so i am Mac-only right now. Anyway, i hope you like it! I sure do and think it ain&#8217;t bad for just a couple hours.</p>
<p>Update:</p>
<pre class="sh_php">
class Author {
	protected $name = '';
	protected $subject = '';
	protected $mood = '';
	public function __construct($name) {
		$this->name = $name;
	}
	public function getName() {
		return $this->name;
	}
	public function getMood() {
		return $this->mood;
	}
	public function getSubject() {
		return $this->subject;
	}
	public function setMood($string) {
		$this->mood = $string;
		return $this;
	}
	public function setSubject($string) {
		$this->subject = $string;
		return $this;
	}
	public function __toString() {
		return "{$this->getName()} is {$this->getMood()} about {$this->getSubject()}";
	}
}

$m3nt0r = new Author('m3nt0r');
$m3nt0r->setSubject('current design')->setMood('happy');
echo $m3nt0r;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/02/cakealotcom-redesign/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Working on a Mac &#8211; Tools that rule</title>
		<link>http://cakealot.com/2009/02/working-on-a-mac_tools-that-rule/</link>
		<comments>http://cakealot.com/2009/02/working-on-a-mac_tools-that-rule/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 23:11:50 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macintosh]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=164</guid>
		<description><![CDATA[A large summary of a couple apps that i use on a daily basis paired with praise and some hints when working on mac.]]></description>
			<content:encoded><![CDATA[<p>If you are a expirienced mac user this is probably not news, but if you just starting out i want to highlight some apps that proven useful in the past.</p>
<p><span id="more-164"></span></p>
<h3>The IDE of choice</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-12.png" alt="ZDE 6.1" title="ZDE 6.1" width="94" height="124" class="alignleft size-full wp-image-194" />Well&#8230; you can&#8217;t say there is a definite one and it&#8217;s a personal preference after all, but i stick with Zend Studio for Eclipse. Not only because it offers the best Integration into the OS but because of the configuration options. These are more on-point than other Eclipse based Apps (without all the clutter). Sure there is a somewhat steep learning curve but once you got a hang on it you don&#8217;t want anything else. Trust me. I tried them all for more then just one look. ZDE6 looks best and runs smooth. Notably: Source Formatter, PHP code analyzer, w00t debugger, library include path variables and custom environment settings.  </p>
<h3>For the quick hack</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-3.png" alt="Textmate" title="Textmate" width="86" height="117" class="alignleft size-full wp-image-166" />Whatever IDE you choose, there will be something you don&#8217;t like at some point or a filetype that doesn&#8217;t work the way it should. Or maybe you just want to quick edit a file for fun. Buy and use Textmate if anything. Some people even use it to replace their IDE, and with plugins like ProjectPlus it almost looks like one. If you didnt fall for my previous praise, then at least fall for this one. It is the best editor known to man kind. And on a sidenote: because of that you will see it often integrated in other apps (edit with.. etc). Textmate is highly customizable and extensible with &#8220;Bundles&#8221; and &#8220;Plugins&#8221;. </p>
<h3>SVN with style</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-13.png" alt="Versions" title="Versions" width="86" height="122" class="alignleft size-full wp-image-196" />I hope you use version control. You should.. And if you use Subversion on alot of projects then have a look at Versions. It recently came out and is the most beautiful and most reliable client available. Don&#8217;t bother other tools. Tried them all but Versions is a keeper. Just give it a try and add a local working copy. It will automaticly add the repo and show you what&#8217;s going on in your project. Everything is organized in bookmarks. It also allows to add ticket urls. So if you commit a patch related to a ticket it will show you the link to your Trac/Lighthouse/whatever. You can inspect, move, copy, branch, tag, blame directly in your local working copy or remotly on the repository. </p>
<h3>Getting things done</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-4.png" alt="Things" title="Things" width="81" height="120" class="alignleft size-full wp-image-173" />This is probably the most beautiful GTD app available and it works the way you work. You can categorize your task with easy reusable tags. There are 5 main &#8220;focus&#8221; sections that will tell you how clutter free yet powerful this app is: Today, Next, Planned, Someday and Projects. All new task go in Inbox first. From there you can move them around if you want. There are two other sections that are Projects (think of them as a category) and Areas (related tasks). Again: You are not forced to anything. This is what i and many other people like about it. Things also offers a iPhone app which is just as powerful. Costs a little extra but gives you the power of syncing your task.</p>
<h3>Tracking your time</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-6.png" alt="bild-6" title="bild-6" width="88" height="120" class="alignleft size-full wp-image-177" />If your are into contract work you probably have the need to track your time. Say hello to OnTheJob 3. You can manage your clients and clients may have many projects. Projects have many tasks and each item has a individual time line and costs. You can configure your deal with the client: fixed rate, hourly rate, etc.. These settings are inherited into the related projects, but you may overwrite specificly if you want. A very flexible and clutterfree app. To mention is also the billing facility. It comes with templates to generate a bill right from the app. Save as PDF, print or email. It tracks the bills and tells you when a bill is overdue. So not only you get your time tracked and managed &#8211; you also can manage your bills. Great little app!</p>
<h3>Uploading your work</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-8.png" alt="bild-8" title="bild-8" width="91" height="119" class="alignleft size-full wp-image-181" />This app is free, but without a reason. It supports FTP, SFTP, WebDAV, iDisk, SCP, Amazon S3/CloudFront and Rackspace Cloud Files. So basicly: Anything. Comes with tons of options and languages. It seamlessly integrates with Editors like Textmate and also gives you the Leopard QuickView on remote files along with Springload browsing. Bookmarks, Syncronize feature etc&#8230; It is almost too much to name. Don&#8217;t bother with other FTP apps. Not even if they are commercial. I haven&#8217;t encountered a FTP Software that beats this one here and i highly recommend it. Never crashed on me. Oh.. and if you want to work remotely: no problem. All files are loaded into one generic folder which you could open as project in TextMate. Growl support is included too.</p>
<h3>Manage your passwords</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-7.png" alt="1Password" title="1Password" width="89" height="121" class="alignleft size-full wp-image-183" />If there is one thing that is quiet annoying, it&#8217;s the amount of account data to remember. I use 1Password which encrypts and saves webforms and other personal data. It comes with plugins for all major browser and integrates flawlessly. Even on Basic-Auth logins. Let&#8217;s say i sign up on some new website. I use the browser extension to generate a secure password. As soon as i hit &#8220;sign-up&#8221; the app asks me to &#8220;create a new login&#8221; so it now knows my login for the site. The next time i revisit the site i just click one button and 1Password fills in the form for me. Note that i don&#8217;t need to make up my own password or even worry about it later on.. As a webdev the Secure Note feature is useful. I use it to store my serial numbers and SSH/FTP logins. </p>
<h3>Chat on IRC</h3>
<p><img src="http://static.cakealot.com/wp-content/uploads/2009/02/bild-9.png" alt="bild-9" title="bild-9" width="89" height="119" class="alignleft size-full wp-image-186" />This is not really dev-related, but if you work with CakePHP, MySQL, Apache, Prototype.js or jQuery you probably had to pay IRC a visit to bug the authors ;-). From all clients available i found Colloquy to be the best. One cool thing is the integration with the Mac AddressBook app. You can connect IRC nicknames to people in your AdresseBook. So whenever they come online or idle for a longer period you see a status icon next to them. This app also supports Growl which is triggered when you name is highlighted in the chat. So you can safely move it out the way and patently wait for a reply. There are also a bunch of themes and plugins available and you can pretty much configure all events. Auto-Join and Auto-Connect make this useful app complete.</p>
<h3>Links</h3>
<ul>
<li>Zend Studio &#8211; <a href="http://www.zend.com/products/studio/">http://www.zend.com/products/studio/</a></li>
<li>TextMate &#8211; <a href="http://macromates.com/">http://macromates.com/</a></li>
<li>Versions &#8211; <a href="http://versionsapp.com/">http://versionsapp.com/</a></li>
<li>Things &#8211; <a href="http://culturedcode.com/things/">http://culturedcode.com/things/</a></li>
<li>OnTheJob &#8211; <a href="http://stuntsoftware.com/OnTheJob/">http://stuntsoftware.com/OnTheJob/</a></li>
<li>Cyberduck &#8211; <a href="http://cyberduck.ch/">http://cyberduck.ch/</a></li>
<li>1Password &#8211; <a href="http://agilewebsolutions.com/products/1Password">http://agilewebsolutions.com/products/1Password</a></li>
<li>Colloquy &#8211; <a href="http://colloquy.info/">http://colloquy.info/</a></li>
</ul>
<h3>Word about addons</h3>
<p>Sure there is more to make your life easier, but first install the developer tools from your Mac-install disc. You need them at some point. Especially if you want to compile software from source. </p>
<p>Loving the Shell (Terminal) much but missing your favorite Linux command? Then have a look at <a href="https://macports.org/">MacPorts</a>. You will get something that resemble Debians &#8220;apt-get&#8221;, dubbed &#8220;port&#8221;. I used it to get my hands on &#8220;wget&#8221;, &#8220;tree&#8221; and &#8220;curl&#8221; among other things, like &#8220;git&#8221;. While at it i also suggest to do a &#8220;sudo gem install cheat&#8221;. The &#8220;cheat&#8221; command prints out cheatsheets right in the console for almost anything. For example, try &#8220;cheat yui&#8221;. </p>
<p>If you are adventurous you could try to setup your own LAMP stack with macports (which has almost always the latest and greatest). I prefer <a href="http://www.mamp.info/">MAMP</a> because it is painless. You don&#8217;t need &#8220;pro&#8221; for CakePHP development. I suggest to edit the DocumentRoot in the httpd.conf and point it to your &#8220;Sites&#8221; folder in your home directory (~). In return you get a nice folder icon from Mac OSX for all your web apps. If you want custom domains for virtual hosts have a look at /etc/hosts. Just make up a name and point it to localhost &#8211; done!</p>
<p>Also check out Jing Project. <a href="http://jingproject.com">Jing</a> is a screenshot utility. After taking the video (w/ voice) or screenshot (w/ comments) you just click one button and it is uploaded to a private location and after the upload it will put the tiny URL to your clipboard for easy sharing. I use this alot in process. </p>
<p>If your mac is configured to save power and the screen get&#8217;s black while you where just thinking about your next step you can turn this temporarly off using &#8220;Caffeine&#8221;. This small toolbar icon turns off screensavers and stuff when enabled. Get it from <a href="http://lightheadsw.com/caffeine/">here</a>.</p>
<p>Last but not least. If you are a terminal hacker (aren&#8217;t we all when baking?) i recommend &#8220;Visor&#8221;. <a href="http://code.google.com/p/blacktree-visor/">Visor</a> gives you a hotkey to the console and when triggered scrolls down a terminal from the top of your screen (thus &#8216;visor&#8217;). Pretty handy to bake something while remaing in the IDE.</p>
<h3>That&#8217;s all, folks!</h3>
<p>I hope you enjoyed this post and take something from it. If you know any other tools that are worthwhile hit the comment section. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/02/working-on-a-mac_tools-that-rule/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP 1.2.1 is out! (r8004)</title>
		<link>http://cakealot.com/2009/01/cakephp-121-is-out-r8004/</link>
		<comments>http://cakealot.com/2009/01/cakephp-121-is-out-r8004/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 23:14:35 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[1.2.1]]></category>
		<category><![CDATA[announcement]]></category>
		<category><![CDATA[bakery]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://cakealot.com/2009/01/cakephp-121-is-out-r8004/</guid>
		<description><![CDATA[On twitter i just took note that theres a new release out. Cool! Check out the announcement in the bakery and download it from your favorite source. I&#8217;ll do &#8220;svn up&#8221; for now and enjoy. 
]]></description>
			<content:encoded><![CDATA[<p>On <a href="http://twitter.com/raisinbread/status/1124954600">twitter</a> i just took note that theres a new release out. Cool! Check out <a href="http://bakery.cakephp.org/articles/view/release-1-2-1-8004">the announcement in the bakery</a> and download it from your favorite source. I&#8217;ll do &#8220;svn up&#8221; for now and enjoy. </p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/01/cakephp-121-is-out-r8004/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Runtime &#8211; Get various system infos (UPDATE)</title>
		<link>http://cakealot.com/2009/01/runtime-get-various-system-infos/</link>
		<comments>http://cakealot.com/2009/01/runtime-get-various-system-infos/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 18:38:59 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cake-bits]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[libs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=80</guid>
		<description><![CDATA[Today i wrote a lib that helps you with checking for loaded extensions, read version strings, read/write include paths and read/write environment vars, etc.. ]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://cakealot.com/2008/12/environment-and-database-config-easy-cakephp-deployment/">my recent post</a> i talked about the Environment class and how to use it to switch databases with ease. Today i paid the <a href="http://www.neilcrookes.com/">blog of Neil Crookes</a> a visit and found his <a href="http://www.neilcrookes.com/2008/11/28/runtime-config-in-cakephp-apps/">most recent post</a> to be of the same nature. How to make life easier with using environment variables in config/bootstrap. </p>
<p>In a comment <a href="http://cakebaker.42dh.com/">Daniel Hofstetter</a> was suggesting to encapsulate his env-tests into a class, and that&#8217;s what i basicly just did (&#8221;hope you like it, Neil&#8221;). Besides checking the OS you can also check for loaded extensions, read version strings, modify include paths and manage environment variables. There are some other handy shorthand methods too. </p>
<p>Again probably easy to combine with <a href="http://rafaelbandeira3.wordpress.com/2008/12/05/handling-multiple-enviroments-on-cakephp/">Environment</a> and <a href="http://book.cakephp.org/view/42/The-Configuration-Class">Configure</a> and together a very decent set of tools for automated deployment, i think. Full PHPDoc included. If you want to know how each method works just look at the source ;-)</p>
<p>Hop over to GitHub: <a href="http://github.com/m3nt0r/cake-bits/tree/master/libs/runtime.php">github.com/m3nt0r/cake-bits/tree/master/libs/runtime.php</a></p>
<p><strong>Update:</strong><br />
I have added a bunch of new methods for Apache and tweaked the API a little to be more consistent (renamed two methods). I also added a <a href="http://github.com/m3nt0r/cake-bits/tree/master/libs/examples/runtime_examples.php">example script with some demo calls</a> to the lib folder. But it should all be pretty self-explanatory. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/01/runtime-get-various-system-infos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP Logging and the MacOSX dashboard</title>
		<link>http://cakealot.com/2009/01/cakephp-logging-and-the-macosx-dashboard/</link>
		<comments>http://cakealot.com/2009/01/cakephp-logging-and-the-macosx-dashboard/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 02:24:13 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=67</guid>
		<description><![CDATA[How to use a handy MacOSX dashboard widget to display the most recent lines from the CakePHP logs.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a hint for all you mac bakers: If you use the debug and error log files in your &#8220;tmp&#8221; directory or not. There is a very handy widget that helps you to keep track of their contents. </p>
<p>It&#8217;s called <a href="http://protagonist.co.uk/tailDash/">tailDash</a> and basicly shows a black tinted window containing the last X lines of a file. Hence the name &#8220;tail&#8221; which is probably known to linux console users. You can have multiple instances each covering a file of your choice (slowquery.log anyone?).</p>
<p>All you need to do is to add the widget to your dashboard and jump into the config panel by clicking the little (i) button on the top right corner. You will then see the config panel which looks like this:</p>
<p><img src="http://cakealot.com/wp-content/uploads/2009/01/bild-1.gif" alt="Default" title="Default" width="503" height="157" class="aligncenter size-full wp-image-77" /><br />
There is a small dropdown on the bottom left where you can choose which system log to display. But there&#8217;s also a &#8220;advanced&#8221; option. Of course we go advanced, since this allows us to type in a full path to any file on the computer. </p>
<p><img src="http://cakealot.com/wp-content/uploads/2009/01/bild-2.gif" alt="Setup" title="Setup" width="497" height="154" class="aligncenter size-full wp-image-78" /><br />
Now you know what to set. Feel free to play with the display options like color and opacity. You could use the color to label which project the output belongs to for example..</p>
<p>Homepage &#038; Download:<br />
<a href="http://protagonist.co.uk/tailDash/">tailDash @ protagonist.co.uk</a></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2009/01/cakephp-logging-and-the-macosx-dashboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Events in CakePHP &#8211; I really like it</title>
		<link>http://cakealot.com/2008/12/events-in-cakephp-i-really-like-it/</link>
		<comments>http://cakealot.com/2008/12/events-in-cakephp-i-really-like-it/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 05:10:58 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=27</guid>
		<description><![CDATA[I am playing around with a custom "events" implementation i just finished and i must say that this is really beautiful...]]></description>
			<content:encoded><![CDATA[<p>I am playing around with a custom &#8220;events&#8221; implementation i just finished and i must say that this is really beautiful. Okay, you have more files to manage, but in exchange you get cleaner main files (controllers, models, etc.). So yeah &#8211; it&#8217;s also a second abstraction level, but i think a very powerful one and worth to look into. </p>
<p>Think that you never ever again need to overwrite beforeFilter just to tell Auth what to allow in one controller. Or how Models could talk to each other. You can overwrite and apply events like there&#8217;s no tommorow too, and thus seperate tedious side-logic from the central businesslogic. </p>
<p><span id="more-27"></span><br />
<h3>How i did it</h3>
<p>As convenient and close to cake conventions as possible i guess. I have a <em>app_controller_events.php</em> and <em>app_model_event.php</em> file in my &#8220;app&#8221; folder, and from those i extend any custom event listener classes while keep the file names they belong to. Those classes are stored in &#8220;/app/events&#8221; and seperated in folders &#8220;controllers&#8221; and &#8220;models&#8221;. Can you already see where this is heading? :)</p>
<p>For controllers i wrote a EventComponent that is a wrapper to the EventDispatcher instance which sits in the ClassRegistry right from the boot. So i can get the instance anywhere in CakePHP. Now upon EventComponent::initialize($controller) i use the Inflector to make up my filenames based on Controller::$name and build a path to the event class. That looks something like this then:</p>
<p><code>/app/events/controllers/users_controller.php </code></p>
<p>If the file doesnt exists, simply nothing happens. Meaning that there is no need to create the file just because a controller exists. Same goes for event methods. If they don&#8217;t exist then the dispatch wont make your app fail. Clean and unobstrusive.</p>
<p>Besides the default events like <em>beforeFilter</em>, <em>beforeRender</em> etc.. i added a &#8220;per action&#8221; version of those too. Pretty cool. Besides the controller wide &#8220;beforeFilter&#8221; i now have a special one for the method. It goes by &#8220;beforeFilter_view&#8221;, for example.</p>
<pre class="sh_php">
class UserControllerEvents extends AppControllerEvents {
   var $name = 'UserController';
   function onBeforeFilter($event) {
       $event->Controller->Auth->allow('register');
   }
}
</pre>
<p>If i want to dispatch from anywhere in my register() action for example, i could just write:</p>
<pre class="sh_php">$this->Event->dispatch('userRegistrationSaved', array('user_id' => $this->User->id));</pre>
<p>Now if i want to do something in my UserController event-handler i just add a method by that name and prefix it with &#8220;on&#8221;. </p>
<pre class="sh_php">
class UserControllerEvents extends AppControllerEvents {
   var $name = 'UserController';
   function onUserRegistrationSaved($event) {
       $event->Controller->log('New registration: User.id = '.$event->user_id);
   }
}</pre>
<p>And so forth .. For models it is practicly the same. The fun thing is that i extend from the Events base implementation aswell. So i can dispatch even more events from one event (i.e. grouping of related events). </p>
<p>I still have to investigate and find more use cases. I don&#8217;t want to replace the controller actions by event handlers, so one needs to be careful what he is adding as a event. This can be neat if done well. </p>
<p>Once i find more practical use and have the time i will release some code. Any comments on the subject are welcome. Maybe you have some more ideas for this.. or you don&#8217;t like it all. Could be either. Let me know! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2008/12/events-in-cakephp-i-really-like-it/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://cakealot.com/2008/12/hello-world/</link>
		<comments>http://cakealot.com/2008/12/hello-world/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 13:39:45 +0000</pubDate>
		<dc:creator>Kjell</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blogging]]></category>

		<guid isPermaLink="false">http://cakealot.com/?p=4</guid>
		<description><![CDATA[Yeah.. hello to whom it may concern. :)
CAKEALOT
&#8230; is going to be my english-written blog about CakePHP (finally!). My native language is german (that why this is &#8220;news&#8221;). Please ignore any bad spelling from now on &#8211; I&#8217;ll do my best. In this blog i will post interesting and not-so-interesting articles about cake/bake and all [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah.. hello to whom it may concern. :)</p>
<p><strong>CAKEALOT</strong><br />
&#8230; is going to be my english-written blog about CakePHP (finally!). My native language is german (that why this is &#8220;news&#8221;). Please ignore any bad spelling from now on &#8211; I&#8217;ll do my best. In this blog i will post interesting and not-so-interesting articles about cake/bake and all related stuff. Related stuff as in &#8220;prototype.js&#8221; and other third party libs and bits.</p>
<p><strong>Who are you anyway? </strong><br />
My name is Kjell and some may know me as &#8220;m3nt0r&#8221; who&#8217;s in #cakephp on freenode IRC quiet often. I am baking for about two or three years now (cant remember) and right now i am working on a mac. So expect some mac osx hints aswell&#8230; I know PHP, JS and whatnot and have alot expirience to share &#8211; in regard of this blog, thats practicly it. ;-)</p>
<p><strong>&#8220;This&#8221; and &#8220;that&#8221; blog</strong><br />
I do have a blog already, which is about 5 years old. Thing is that <a href="http://www.m3nt0r.de">the blog</a> is 95% in german. I did write some posts in english there, but i found that it&#8217;s not going to work. Not anymore however&#8230; And why mix up the good stuff? So i decided to start this blog for all my english writings with focus on CakePHP.</p>
<p>Enjoy &amp; Merry Christmas everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakealot.com/2008/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
