<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Developing In The Dark</title><generator>Tumblr (3.0; @developinginthedark)</generator><link>http://bytes.developinginthedark.com/</link><item><title>CakePHP Visible URL Links Using Proper Routes</title><description>&lt;p&gt;If you are every writing body content that requires you to mention a local URL then you are like to be tempted to write a very static, such as:

&lt;pre class="code"&gt;
&lt;code class="html"&gt;
&lt;a href="http://yourdomain.com/users/login"&gt;&lt;a href="http://yourdomain.com/users/login"&gt;http://yourdomain.com/users/login&lt;/a&gt;&lt;/a&gt;
&lt;/code&gt;
&lt;/pre&gt;

Instead it&amp;#8217;s better to use CakePHP routes, just in case you change the URL structure of your site (ie, to use pretty urls, etc). So instead do something like this:

&lt;pre class="code"&gt;
&lt;code class="php"&gt;
&lt;?php echo $html-&gt;link(Router::url(array('controller' =&amp;gt; 'users', 'action' =&amp;gt; 'login'), true), array('controller' =&amp;gt; 'users', 'action' =&amp;gt; 'login')) ?&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/442511731</link><guid>http://bytes.developinginthedark.com/post/442511731</guid><pubDate>Fri, 12 Mar 2010 14:27:01 +1100</pubDate><category>cakephp</category></item><item><title>Setting Timezone in CakePHP</title><description>&lt;p&gt;When looking over my friend &lt;a href="http://tonymilne.com.au"&gt;Tony Milne&lt;/a&gt;&amp;#8217;s shoulder as he worked on &lt;a href="http://tonymilne.com.au"&gt;his new blog&lt;/a&gt; built in CakePHP, we ran into the issue of our server being hosted in the US so comment timestamps were being given dates based on the current US date/time. To change the timezone CakePHP uses just place the following in your &lt;em&gt;bootstrap.php&lt;/em&gt;&lt;/p&gt;

&lt;pre class="code"&gt;
&lt;code class="php"&gt;
// place in app/config/bootstrap.php 
// Australia Daylight Saving timezone
putenv('TZ=AEDT');
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;
See also:
&lt;br/&gt;&lt;a href="http://www.timeanddate.com/library/abbreviations/timezones/"&gt;List of Timezone Abbreviations&lt;/a&gt;
&lt;br/&gt;&lt;a href="http://planetcakephp.org/aggregator/items/1647-convert-server-timezone-to-a-different-timezone-in-cakephp"&gt;Original Solution&lt;/a&gt;
&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/440527495</link><guid>http://bytes.developinginthedark.com/post/440527495</guid><pubDate>Thu, 11 Mar 2010 15:55:00 +1100</pubDate><category>timezone</category><category>cakephp</category></item><item><title>Install &amp; Uninstall MySQL - Ubuntu</title><description>&lt;p&gt;Ran into an issue on with a VPS on Slicehost that I cloned the other day. The MySQL server wouldn&amp;#8217;t start as it failed to find the mysqld.sock file (which appeared to be non-existent). I uninstalled MySQL, which was fine because we didn&amp;#8217;t need any of the cloned databases and then just reinstalled it.&lt;/p&gt;

Install MySQL:
&lt;pre class="code"&gt;
&lt;code class="bash"&gt;
sudo aptitude install mysql-server mysql-client libmysqlclient15-dev
&lt;/code&gt;
&lt;/pre&gt;

Remove MySQL:
&lt;pre class="code"&gt;
&lt;code class="bash"&gt;
sudo apt-get --purge remove mysql-server mysql-common mysql-client libmysqlclient15-dev libmysql-ruby 
&lt;/code&gt;
&lt;/pre&gt;

As a side note, this article has extended information about adding and removing users to your MySQL installation: &lt;a href="http://articles.slicehost.com/2008/7/10/mysql-creating-and-editing-users"&gt;&lt;a href="http://articles.slicehost.com/2008/7/10/mysql-creating-and-editing-users"&gt;http://articles.slicehost.com/2008/7/10/mysql-creating-and-editing-users&lt;/a&gt;&lt;/a&gt;</description><link>http://bytes.developinginthedark.com/post/427138466</link><guid>http://bytes.developinginthedark.com/post/427138466</guid><pubDate>Fri, 05 Mar 2010 11:26:00 +1100</pubDate><category>mysql</category><category>slicehost</category></item><item><title>JQuery Dialog - Lightbox Alternative</title><description>&lt;p&gt;A project currently being developed needed a popup box similar to Lightbox or Fancybox but not for the purpose of displaying photos, video, slideshows, etc but to purely be used to render a page within a floating box - without all the bells and whistles. The solution has been &lt;a href="http://codaset.com/joelmoss/codaset-dialog"&gt;Joel Moss&amp;#8217; Codaset Dialog&lt;/a&gt;. Its beauty is in its simplicity and clean widgetless design.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Tip: On line 180 we found easing being set to &amp;#8220;swing&amp;#8221; provided a smoother animation in more browsers.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_kxp4sqCxga1qacc49.png"/&gt;&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/386172618</link><guid>http://bytes.developinginthedark.com/post/386172618</guid><pubDate>Sat, 13 Feb 2010 10:12:12 +1100</pubDate><category>jquery</category></item><item><title>Embeded Video with "Video for Everybody"</title><description>&lt;p&gt;Just wanted to point out this &lt;a href="http://camendesign.com/code/video_for_everybody"&gt;Video for Everybody&lt;/a&gt; site as a neat tool to have in your toolbelt. It basically provides a snippet of HTML that attempts to best show users video based on their system - with multiple fallback included depending on whether or not certain technologies are supported. &lt;/p&gt;

&lt;p&gt;Worth checking out!&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/384299031</link><guid>http://bytes.developinginthedark.com/post/384299031</guid><pubDate>Fri, 12 Feb 2010 08:18:21 +1100</pubDate><category>video</category></item><item><title>Terminal Tip - Remove .svn Files</title><description>&lt;p&gt;A quick way to remove all the annoying little .svn files recursively from a working copy. Its a bit of a hack way of doing a svn export.
&lt;pre class="code"&gt;
&lt;code class="bash"&gt;
find ./ -name ".svn" | xargs rm -Rf
&lt;/code&gt;
&lt;/pre&gt;&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/362070045</link><guid>http://bytes.developinginthedark.com/post/362070045</guid><pubDate>Sun, 31 Jan 2010 10:05:57 +1100</pubDate><category>terminal</category><category>svn</category></item><item><title>JavaScript "Syntactic Sugar"</title><description>&lt;p&gt;I&amp;#8217;ve just been glancing over &lt;a href="http://stackoverflow.com/questions/180841/best-javascript-syntactic-sugar"&gt;this post&lt;/a&gt; about JavaScript syntax goodies (aka sugar) on StackOverflow. Two highlights were: &lt;/p&gt;

&lt;h4&gt;Defaults&lt;/h4&gt;
&lt;p&gt;I&amp;#8217;ve been jealous of ruby having this method - php doesn&amp;#8217;t have an equally succinct equivelant - however it appears Javascript does.&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;code class="javascript"&gt;
arg = arg || 'default'; // if arg evaluates to false, use 'default'
&lt;/code&gt;
&lt;/pre&gt;

&lt;h4&gt;Object Membership Test&lt;/h4&gt;
&lt;p&gt;A nice, natural way to check for object members.&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;code class="javascript"&gt;
var props = { a: 1, b: 2 };

("a" in props) // true
("b" in props) // true
("c" in props) // false
&lt;/code&gt;
&lt;/pre&gt;</description><link>http://bytes.developinginthedark.com/post/360281846</link><guid>http://bytes.developinginthedark.com/post/360281846</guid><pubDate>Sat, 30 Jan 2010 10:04:52 +1100</pubDate><category>javascript</category><category>syntax</category></item><item><title>CakePHP Sequence Behaviour</title><description>&lt;p&gt;I&amp;#8217;ve yet to use this &lt;a href="http://www.neilcrookes.com/2009/02/09/cakephp-sequence-behavior/"&gt;CakePHP Sequence Behaviour&lt;/a&gt; but it seems like a solid solution for any model that you want to maintain an order to the records. The &lt;a href="http://labs.neilcrookes.com/sequence_demo/items"&gt;demo&lt;/a&gt; shows it being implemented with drag and drog.&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/358558853</link><guid>http://bytes.developinginthedark.com/post/358558853</guid><pubDate>Fri, 29 Jan 2010 10:05:57 +1100</pubDate><category>cakephp</category></item><item><title>JQuery Plugin - HoverIntent</title><description>&lt;p&gt;My coding partner in crime &lt;a href="http://twitter.com/tonymilne"&gt;Tony Milne&lt;/a&gt; pointed me in the direction of the &lt;a href="http://cherne.net/brian/resources/jquery.hoverIntent.html"&gt;HoverIntent&lt;/a&gt; JQuery plugin today whilst we were attempting to delay the appearance of &lt;a href="http://onehackoranother.com/projects/jquery/tipsy/"&gt;Tipsy&lt;/a&gt; (previously &lt;a href="http://bytes.developinginthedark.com/post/352154857/tipsy-jquery-tooltip-plugin"&gt;mentioned here&lt;/a&gt;&lt;a&gt;&lt;/a&gt;) tooltips.&lt;/p&gt;

&lt;p&gt;HoverIntent attempts to improve JQuery&amp;#8217;s &amp;#8220;hover&amp;#8221; event by delaying the event until it appears the user is actually actively trying to hover on an item.&lt;/p&gt;

&lt;p&gt;Extract from the homepage:&lt;/p&gt;
&lt;blockquote&gt;
&amp;#8230;instead of immediately calling the onMouseOver function, it waits until the user&amp;#8217;s mouse slows down enough before making the call.
&lt;/blockquote&gt;</description><link>http://bytes.developinginthedark.com/post/355905720</link><guid>http://bytes.developinginthedark.com/post/355905720</guid><pubDate>Wed, 27 Jan 2010 20:35:34 +1100</pubDate><category>jquery</category></item><item><title>PostBin - Easily Debug Web Hooks</title><description>&lt;p&gt;If you are doing any experimenting with &lt;a href="http://blog.webhooks.org/"&gt;web hooks&lt;/a&gt;, there&amp;#8217;s a neat little site - &lt;a href="http://www.postbin.org/"&gt;&lt;a href="http://www.postbin.org/"&gt;http://www.postbin.org/&lt;/a&gt;&lt;/a&gt; - that allows you to easily see what POST data is being sent from a web hook provider (ie, &lt;a href="http://mitcho.com/code/hookpress/"&gt;HookPress for WordPress&lt;/a&gt;).&lt;/p&gt;

&lt;a href="http://www.postbin.org/"&gt;&lt;img src="http://media.tumblr.com/tumblr_kwp7o4ipBe1qacc49.png"/&gt;&lt;/a&gt;</description><link>http://bytes.developinginthedark.com/post/355555952</link><guid>http://bytes.developinginthedark.com/post/355555952</guid><pubDate>Wed, 27 Jan 2010 15:20:59 +1100</pubDate><category>webhooks</category></item><item><title>I chalk this down as the most inspiring speeches I’ve ever...</title><description>&lt;iframe width="400" height="299" src="http://www.youtube.com/embed/UF8uR6Z6KLc?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I chalk this down as the most inspiring speeches I’ve ever watched/listened too.&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/353542613</link><guid>http://bytes.developinginthedark.com/post/353542613</guid><pubDate>Tue, 26 Jan 2010 13:02:35 +1100</pubDate><category>steve jobs</category><category>inspiration</category></item><item><title>Tipsy - JQuery Tooltip Plugin</title><description>&lt;p&gt;I needed a quality tooltip plugin and after looking at a few I fortunately stumbled upon Tipsy (&lt;a href="http://onehackoranother.com/projects/jquery/tipsy/"&gt;homepage&lt;/a&gt; &amp;amp; &lt;a href="http://github.com/jaz303/tipsy"&gt;github&lt;/a&gt;). If you&amp;#8217;re in the market for one, its worth checking out. Based on Facebook&amp;#8217;s tooltips and used by Twitter, Github, plus others.&lt;/p&gt;

&lt;img src="http://media.tumblr.com/tumblr_kwsh4fR8qv1qacc49.png"/&gt;</description><link>http://bytes.developinginthedark.com/post/352154857</link><guid>http://bytes.developinginthedark.com/post/352154857</guid><pubDate>Mon, 25 Jan 2010 17:12:28 +1100</pubDate><category>jquery</category></item><item><title>Secure Google Apps Email Using SPF</title><description>&lt;p&gt;Almost every domain I get my hands on I end up adding &lt;a href="http://www.google.com/apps/intl/en/group/index.html"&gt;Google Apps&lt;/a&gt; as the email server/software. The other day I was setting up yet another installation when I stumbled across this &lt;a href="https://articles.slicehost.com/2008/8/8/email-setting-a-sender-policy-framework-spf-record"&gt;helpful slicehost article&lt;/a&gt; about preventing email from your domain being forged and being treated as spam by other clients.&lt;/p&gt;

&lt;p&gt;Googles own &lt;a href="http://www.google.com/support/a/bin/answer.py?hl=en&amp;amp;answer=33786"&gt;support page&lt;/a&gt; outlines that all you have to do is:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Add a new TXT record in your DNS settings&lt;/li&gt;
  &lt;li&gt;Set the value of the record to: &lt;b&gt;v=spf1 include:aspmx.googlemail.com ~all&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://media.tumblr.com/tumblr_kwp720IXzd1qacc49.png"/&gt;&lt;br/&gt;&lt;em&gt;Screenshot of an example Slicehost record.&lt;/em&gt;</description><link>http://bytes.developinginthedark.com/post/351479158</link><guid>http://bytes.developinginthedark.com/post/351479158</guid><pubDate>Mon, 25 Jan 2010 09:59:35 +1100</pubDate><category>google</category><category>security</category><category>email</category></item><item><title>As we are currently going through testing our latest web app at...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kwp6018POF1qakws9o1_400.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;As we are currently going through testing our latest web app at work, I was comforted to see that somethings slip through even the biggest players in the industry.&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/348873408</link><guid>http://bytes.developinginthedark.com/post/348873408</guid><pubDate>Sat, 23 Jan 2010 22:16:49 +1100</pubDate></item><item><title>jQuery Cookie Plugin</title><description>&lt;p&gt;Very easy implementation for interacting with browser cookies using jquery&lt;/p&gt;

&lt;pre class="code"&gt;
&lt;code class="javascript"&gt;
$.cookie('the_cookie'); // get cookie
$.cookie('the_cookie', 'the_value'); // set cookie
$.cookie('the_cookie', 'the_value', { expires: 7 }); // set cookie with an expiration date seven days in the future
$.cookie('the_cookie', null); // delete cookie
&lt;/code&gt;
&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="http://plugins.jquery.com/files/jquery.cookie.js.txt"&gt;Download&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stilbuero.de/jquery/cookie/"&gt;Demo&lt;/a&gt; (view the source to see example js code)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/"&gt;Associated blog post&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://bytes.developinginthedark.com/post/346154457</link><guid>http://bytes.developinginthedark.com/post/346154457</guid><pubDate>Fri, 22 Jan 2010 03:51:57 +1100</pubDate><category>jquery</category><category>cookie</category></item><item><title>Nginx Access Restriction</title><description>&lt;p&gt;A &lt;a href="http://www.alrond.com/en/2007/apr/12/restriction-access-with-nginx/"&gt;detailed article&lt;/a&gt; about how to add basic access restriction on a website using an nginx web server. Use either the perl or ruby script mentioned &lt;a href="http://snippets.aktagon.com/snippets/109-Password-protecting-a-folder-resource-with-Nginx"&gt;here&lt;/a&gt; to generate an encrypted password.&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/346154360</link><guid>http://bytes.developinginthedark.com/post/346154360</guid><pubDate>Fri, 22 Jan 2010 03:51:50 +1100</pubDate><category>nginx</category></item><item><title>CakePHP Flash Messages</title><description>&lt;p&gt;A method you can use to check whether there are flash messages to show:&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;code class="php"&gt;
$session-&amp;gt;check('Message.flash')
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;An example of how you can use it to add custom DOM elements and JavaScript animation:&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;code class="php"&gt;
&amp;lt;?php if($session-&amp;gt;check('Message.flash')) { ?&amp;gt;
  &amp;lt;div id="flash-messages"&amp;gt;
    &amp;lt;?php $session-&amp;gt;flash(); ?&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;script type="text/javascript" charset="utf-8"&amp;gt;
    setTimeout(function () { 
      $('#flash-messages').fadeOut('slow'); 
    }, 4000);
  &amp;lt;/script&amp;gt;
&amp;lt;?php } ?&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Source: &lt;a href="http://labs.iamkoa.net/2008/01/13/session-based-flash-messages-look-better-cakephp/"&gt;Iamkoa Labs&lt;/a&gt;&lt;/p&gt;</description><link>http://bytes.developinginthedark.com/post/346151543</link><guid>http://bytes.developinginthedark.com/post/346151543</guid><pubDate>Fri, 22 Jan 2010 03:48:49 +1100</pubDate><category>cakephp</category></item></channel></rss>

