<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Dave was here</title>
    <link>http://davsblog.me</link>
    <description>Most recent posts at Dave was here</description>
    <generator>posterous.com</generator>
    <link xmlns="http://www.w3.org/2005/Atom" href="http://posterous.com/api/sup_update#9cd2a76b4" type="application/json" rel="http://api.friendfeed.com/2008/03#sup" />
    
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DaveWasHere" /><feedburner:info uri="davewashere" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://posterous.superfeedr.com/" /><item>
      <pubDate>Sat, 19 Mar 2011 16:40:00 -0700</pubDate>
      <title>How to do rollbacks in GIT (in other words - oops, I shouldn't have done that!)</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/yZuDxwNwyMg/how-to-do-rollbacks-in-git-in-other-words-oop</link>
      <guid isPermaLink="false">http://davsblog.me/how-to-do-rollbacks-in-git-in-other-words-oop</guid>
      <description>&lt;p&gt;
	&lt;p&gt;This is divided into two main sections. How to rollback before the code has been committed, and how to rollback after the code has been committed.&lt;/p&gt;

&lt;h2&gt;BEFORE you have committed the code&lt;/h2&gt;

&lt;p&gt;You have already staged a change using &amp;ldquo;git add&amp;rdquo;. You don&amp;rsquo;t want it staged anymore:&lt;/p&gt;

&lt;h3&gt;git reset&lt;/h3&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git reset HEAD filename.txt&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You haven&amp;rsquo;t staged changes yet, but want to rollback your changes to filename.txt:&lt;/p&gt;

&lt;h3&gt;git checkout&lt;/h3&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git checkout -- filename.txt&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;OK, why the two dashes??? Well, if you think about it, the &amp;lsquo;checkout&amp;rsquo; command is usually used to switch branches. The two dashes tells it otherwise.&lt;/p&gt;

&lt;h2&gt;AFTER you have committed the code&lt;/h2&gt;

&lt;p&gt;You have committed code you shouldn&amp;rsquo;t have. Oh dear. You have some choices:&lt;/p&gt;

&lt;h3&gt;git revert&lt;/h3&gt;

&lt;p&gt;&amp;lsquo;git revert&amp;rsquo; will create a new commit which undoes a specifc commit that you pass to it. The usual use is to undo the last commit:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git revert HEAD&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you need to undo a commit that happened &lt;em&gt;before&lt;/em&gt; the last commit you can pass it a caret (Bugs Bunny) or a specific SHA1 of the commit you want to undo:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git revert HEAD^&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;or:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git revert 16829a6f&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you rollback to a commit &lt;em&gt;other&lt;/em&gt; than the last one, and there are merge conflicts created by undoing the change, you will have to deal with those at the time of your new commit (this revert one).&lt;/p&gt;

&lt;h3&gt;git commit —amend&lt;/h3&gt;

&lt;p&gt;&amp;lsquo;git commit —amend&amp;rsquo; is another command that allows you to change your last commit. For example, if I forgot to stage a file for the last commit and I need to edit the commit message:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git commit -m 'initial commit'
$ git add filename.txt
$ git commit --amend&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;It will open your default text editor and allow you to edit the comment. The previous commit is overridden by adding my new &amp;lsquo;filename.txt&amp;rsquo; and now has my new commit message.&lt;/p&gt;

&lt;h3&gt;git reset &amp;mdash;hard&lt;/h3&gt;

&lt;p&gt;This will reset the files, and the commits. Pass in the tag, branch, or commit SHA1:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git reset --hard (tag/branch/commit id)&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;Create a new branch and checkout your chosen commit into that&lt;/h3&gt;

&lt;p&gt;First, rename your master branch:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git branch -m mynewbranch&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Check out your good commit (the one you want to use):&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git checkout f1e4ab2b22&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Make this commit you just checked out your new master branch:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git checkout -b master&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;That&amp;rsquo;s it. You still have your &amp;lsquo;mynewbranch&amp;rsquo; branch, so if you want to get rid of it now, do this:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git branch -D mynewbranch&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Note: You will probably need to run:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;$ git push -f origin master&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;to get master to look like it did at the specified commit because of the non-fastforwards.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/how-to-do-rollbacks-in-git-in-other-words-oop"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/how-to-do-rollbacks-in-git-in-other-words-oop#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/yZuDxwNwyMg" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/how-to-do-rollbacks-in-git-in-other-words-oop</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 03 Mar 2011 04:23:00 -0800</pubDate>
      <title>Removing CVS directories from Subversion</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/Qo-0OhtX_TA/removing-cvs-directories-from-subversion</link>
      <guid isPermaLink="false">http://davsblog.me/removing-cvs-directories-from-subversion</guid>
      <description>&lt;p&gt;
	&lt;p&gt;It&amp;rsquo;s time for a cleanout. A couple of servers here have Drupal 7 installed from CVS. As CVS is no longer used by Drupal, it&amp;rsquo;s time to clean those unneeded directories out of SVN with a mass SVN delete command&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;svn delete `find . -type d | grep 'CVS$'`&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The command in the backticks finds everything of type directory, and then it&amp;rsquo;s passed (piped) to grep which filters the results. The $ at the end of the CVS tells us to only show root CVS directories, nothing inside them.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/removing-cvs-directories-from-subversion"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/removing-cvs-directories-from-subversion#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/Qo-0OhtX_TA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/removing-cvs-directories-from-subversion</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 19 Nov 2010 12:20:00 -0800</pubDate>
      <title>Eclipse IDE - Improving the memory hog</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/RKY9m_Lyfik/eclipse-ide-improving-the-memory-hog</link>
      <guid isPermaLink="false">http://davsblog.me/eclipse-ide-improving-the-memory-hog</guid>
      <description>&lt;p&gt;
	&lt;p&gt;I stopped using Eclipse IDE quite a while back for a couple of reasons. Firstly, I wanted to explore what other IDE&amp;rsquo;s were available, and secondly I thought it was a bit of a memory hog. There is nothing worse than having to restart your IDE every couple of hours when you are deep in fixing code.&lt;/p&gt;

&lt;p&gt;I downloaded Helios the other day from the &lt;a href="http://www.eclipse.org/pdt/"&gt;PDT Project&lt;/a&gt; site which has PHP ready for use. After hunting around, I came across something I thought I&amp;rsquo;d try, and it made quite a lot of difference in the speed.&lt;/p&gt;

&lt;p&gt;Open up the &lt;code&gt;eclipse.ini&lt;/code&gt; file inside the eclipse folder (might be best to make a copy of it just in case!).
Remove the &lt;code&gt;-Xms40m&lt;/code&gt; and &lt;code&gt;-Xmx384m&lt;/code&gt; lines from the bottom. Now put this in at the bottom:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-Xms128m
-Xmx512m
-XX:MaxPermSize=120m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Now start Eclipse (or shut it down and restart if you already had it open). Notice any difference?&lt;/p&gt;

&lt;p&gt;So.., you may be asking, what does all of this do? The notes below are taken from &lt;a href="http://piotrga.wordpress.com/2006/12/12/intellij-and-garbage-collection/"&gt;this&lt;/a&gt; garbage collection (GC) article.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heap size&lt;/strong&gt;&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-Xms256m
-Xmx512m&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The more the better&amp;hellip;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Perm size&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;IntelliJ likes a lot of memory for caching references and class meta information. That is why we need to make sure that cache is not purged. Cache is stored in &amp;lsquo;Old Generation&amp;rsquo; space which size is determined by the following option&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-XX:MaxPermSize=200m&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;General rule is to observe memory indicator after using find symbol option with include non project files selected. If it doesn&amp;rsquo;t move you have chosen enough memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maximum Pause&lt;/strong&gt;&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-XX:MaxGCPauseMillis=10&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;We ask GC to pause the application for no more then 10 milliseconds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proportion of free space&lt;/strong&gt;&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-XX:MaxHeapFreeRatio=70&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;We ask GC to kick off when more than 30% of memory is occupied, so when we start compilation GC will not interfere because it will be enough memory free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrent Mark-Sweep (CMS) Collector&lt;/strong&gt;&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-XX:+UseConcMarkSweepGC&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;We want GC to run in parallel with other threads without freezing the application. This option doesn&amp;rsquo;t stop GC from freezing the application but it reduces it significantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incremental Mode&lt;/strong&gt;&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;-XX:+CMSIncrementalPacing&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;We don&amp;rsquo;t wont to freeze the application so we do GC incrementally with breaks so the application can take a breath. We use Pacing so GC can learn how to use CPU based on application CPU usage.&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/eclipse-ide-improving-the-memory-hog"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/eclipse-ide-improving-the-memory-hog#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/RKY9m_Lyfik" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/eclipse-ide-improving-the-memory-hog</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 10 Nov 2010 15:34:00 -0800</pubDate>
      <title>Improving performance for Drupal development on localhost</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/VECu_54H95M/improving-performance-for-drupal-development</link>
      <guid isPermaLink="false">http://davsblog.me/improving-performance-for-drupal-development</guid>
      <description>&lt;p&gt;
	&lt;p&gt;&lt;span style="font-family: arial, sans-serif; border-collapse: collapse;"&gt;I usually use virtual machines for development if I am on Windows. On this machine I have several VM's with different flavours of Linux for that purpose. However, I also have a WAMP installation which I use if I want to muck with a test Drupal site or just try out some stuff.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial, sans-serif;"&gt;As a lot of people out there know, &lt;a href="http://www.wampserver.com/en/"&gt;WAMP&lt;/a&gt; and &lt;a href="http://www.apachefriends.org"&gt;XAMPP&lt;/a&gt; can really suck at performance. I remember in the past waiting 40 seconds for a page load on a Drupal site which was pretty clean, which of course is enough to make you want to rip your own hair out. After firing WAMP up today for the first time in months, I thought I'd have a hunt around to see if there were any solutions to this problem. Here are two things I found that made quite a difference on my system.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="font-family: arial, sans-serif;"&gt;1. Adjust the&amp;nbsp;realpath_cache_size in php.ini, and set it to a reasonable level. I set mine to 24 meg which is probably a bit too high, some people are saying that even 2 meg gives them improvements. In WAMP you can edit the php.ini file by clicking on the WAMP icon in your toolbar, scrolling up to the PHP section, and clicking on php.ini. Find the line that starts with &lt;/span&gt;&lt;span style="font-family: courier new, monospace;"&gt;&lt;span style="color: #666666;"&gt;;realpath_cache_size&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: arial, sans-serif;"&gt;, and uncomment it out, so it should now read:&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&lt;span style="color: #666666;"&gt;realpath_cache_size=24M&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;2. Disable the IPv6 line in your Windows hosts file (note this will only work on Vista and 7, not XP). You will need to do this as adminstrator, so you may need to right click on the hosts file and choose 'open as administrator'. The file is located at&amp;nbsp;C:\Windows\System32\drivers\etc&lt;/div&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;Change the line:&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&lt;span style="color: #666666;"&gt;::1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;to&lt;/div&gt;
&lt;p /&gt;
&lt;div&gt;&lt;span style="font-family: courier new, monospace;"&gt;&lt;span style="color: #666666;"&gt;#::1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; localhost&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p /&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;and save the file. Basically all you are doing is commenting the line out with a hash (#) so it's not used.&lt;/div&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;See if that makes any difference. I noticed it made an improvement to my overall system, not just WAMP. If you see no difference, then you can always re-edit the hosts file and remove the hash to enable the line again.&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/improving-performance-for-drupal-development"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/improving-performance-for-drupal-development#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/VECu_54H95M" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/improving-performance-for-drupal-development</feedburner:origLink></item>
    <item>
      <pubDate>Tue, 09 Nov 2010 12:48:00 -0800</pubDate>
      <title>Theming Drupal blocks dependent on the region</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/e6G3bAQmUnA/theming-drupal-blocks-dependent-on-the-region</link>
      <guid isPermaLink="false">http://davsblog.me/theming-drupal-blocks-dependent-on-the-region</guid>
      <description>&lt;p&gt;
	&lt;p&gt;The other day I was working with the menu_block module (&lt;a href="http://drupal.org/project/menu_block)"&gt;http://drupal.org/project/menu_block)&lt;/a&gt;, and I was trying to theme the block dependent on the region it was assigned to, to get sets of different looking menus for different page types. The hooks that are in menu_block don&amp;rsquo;t use any region info, just block ID, block name, and whether you are actually using the menu block module. So, here is an easy way to pass the block region into other dependant hooks:&lt;/p&gt;

&lt;p&gt;Firstly, override the theme_block function, and create a global variable called $_current_region. It&amp;rsquo;s also a good idea to set the variable to null just before closing the function. Here is the standard theme_blocks function overridden in template.php:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;function&lt;/span&gt; &lt;span class="fu"&gt;phptemplate_blocks&lt;/span&gt;(&lt;span class="lv"&gt;$region&lt;/span&gt;) {
    &lt;span class="c"&gt;// pass the current block region so we can use it in other hooks later&lt;/span&gt;
    &lt;span class="r"&gt;global&lt;/span&gt; &lt;span class="lv"&gt;$_current_region&lt;/span&gt;;
    &lt;span class="lv"&gt;$_current_region&lt;/span&gt; = &lt;span class="lv"&gt;$region&lt;/span&gt;;

    &lt;span class="c"&gt;// start of standard theme_block hook&lt;/span&gt;
    &lt;span class="lv"&gt;$output&lt;/span&gt; = &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;;

    &lt;span class="r"&gt;if&lt;/span&gt; (&lt;span class="lv"&gt;$list&lt;/span&gt; = block_list(&lt;span class="lv"&gt;$region&lt;/span&gt;)) {
        &lt;span class="r"&gt;foreach&lt;/span&gt; (&lt;span class="lv"&gt;$list&lt;/span&gt; &lt;span class="r"&gt;as&lt;/span&gt; &lt;span class="lv"&gt;$key&lt;/span&gt; =&amp;gt; &lt;span class="lv"&gt;$block&lt;/span&gt;) {
            &lt;span class="lv"&gt;$output&lt;/span&gt; .= theme(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="lv"&gt;$block&lt;/span&gt;);
        }
    }

    &lt;span class="c"&gt;// Add any content assigned to this region through drupal_set_content() calls.&lt;/span&gt;
    &lt;span class="lv"&gt;$output&lt;/span&gt; .= drupal_get_content(&lt;span class="lv"&gt;$region&lt;/span&gt;);

    &lt;span class="c"&gt;// set region to NULL seen as we have now passed it on&lt;/span&gt;
    &lt;span class="lv"&gt;$_current_region&lt;/span&gt; = &lt;span class="pc"&gt;NULL&lt;/span&gt;;

    &lt;span class="r"&gt;return&lt;/span&gt; &lt;span class="lv"&gt;$output&lt;/span&gt;;
}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;So now, we can make that variable available in other functions, for example theme_menu_tree, and theme_menu_item, and you can style the menus dependant on the region. Here is theme_menu_tree:&lt;/p&gt;

&lt;div class="CodeRay"&gt;
  &lt;div class="code"&gt;&lt;pre&gt;&lt;span class="r"&gt;function&lt;/span&gt; &lt;span class="fu"&gt;phptemplate_menu_tree&lt;/span&gt;(&lt;span class="lv"&gt;$tree&lt;/span&gt;) {
    &lt;span class="r"&gt;global&lt;/span&gt; &lt;span class="lv"&gt;$_current_region&lt;/span&gt;;

    &lt;span class="r"&gt;switch&lt;/span&gt; (&lt;span class="lv"&gt;$_current_region&lt;/span&gt;) {
        &lt;span class="r"&gt;case&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;front_menu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;:
            &lt;span class="r"&gt;return&lt;/span&gt; &lt;span class="lv"&gt;$tree&lt;/span&gt;;
            &lt;span class="r"&gt;break&lt;/span&gt;;
        &lt;span class="r"&gt;case&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;content_page_menu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;:
            &lt;span class="r"&gt;return&lt;/span&gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;&amp;lt;ul class=&amp;quot;subnavigation&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; . &lt;span class="lv"&gt;$tree&lt;/span&gt; . &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;;
            &lt;span class="r"&gt;break&lt;/span&gt;;
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/theming-drupal-blocks-dependent-on-the-region"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/theming-drupal-blocks-dependent-on-the-region#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/e6G3bAQmUnA" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/theming-drupal-blocks-dependent-on-the-region</feedburner:origLink></item>
    <item>
      <pubDate>Mon, 02 Aug 2010 15:19:52 -0700</pubDate>
      <title>Create directory and change into it automatically</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/lJ10WO_1CWk/create-directory-and-change-into-it-automatic</link>
      <guid isPermaLink="false">http://davsblog.me/create-directory-and-change-into-it-automatic</guid>
      <description>&lt;p&gt;
	More quick command line geekery.... Create a command in &lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;.bashrc&lt;/span&gt; that lets you create directories and change into them immediately:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;mkcd () {&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(255, 255, 0);" /&gt; &lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;  mkdir -p &amp;quot;$*&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(255, 255, 0);" /&gt;&lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;  cd &amp;quot;$*&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(255, 255, 0);" /&gt; &lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;}&lt;/span&gt;&lt;p /&gt;&lt;br /&gt;so to use it:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: rgb(255, 255, 0);"&gt;mkcd directory/another/yet_another&lt;/span&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/create-directory-and-change-into-it-automatic"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/create-directory-and-change-into-it-automatic#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/lJ10WO_1CWk" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/create-directory-and-change-into-it-automatic</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 25 Jul 2010 14:23:20 -0700</pubDate>
      <title>How to open JPEG images in Camera Raw in Photoshop</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/rRFR8yQFM5U/how-to-open-jpeg-images-in-camera-raw-in-phot</link>
      <guid isPermaLink="false">http://davsblog.me/how-to-open-jpeg-images-in-camera-raw-in-phot</guid>
      <description>&lt;p&gt;
	Have you ever wanted to open a jpeg image in Camera Raw in Photoshop? I do it sometimes as I like working with the camera raw controls, they offer some different options to the usual set of tools in the standard Photoshop tools pallette. Be warned though, you probably won&amp;#39;t get the same range of colour and tone control as you would do with a RAW image. You can however, make sure you set the Depth to 16 Bits/Channel in the Workflow Options inside the Camera Raw window (to get to the Workflow Options, click the link underneath the photo between the &amp;quot;Save Image...&amp;quot; and &amp;quot;Open Image&amp;quot; buttons) to get more depth.&lt;p /&gt; So, here is how you do it:&lt;p /&gt;1. Go to the Photoshop file menu, and click on &amp;quot;Open As...&amp;quot;&lt;br /&gt;2. Browse for the photo you want to open, and highlight it (click on it once with the mouse).&lt;br /&gt;3. In the &amp;quot;Open As&amp;quot; dropdown box down the bottom (underneath the &amp;quot;File name&amp;quot; box), select &amp;quot;Camera Raw&amp;quot;.&lt;br /&gt; 4. Click &amp;quot;Open&amp;quot;.
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/how-to-open-jpeg-images-in-camera-raw-in-phot"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/how-to-open-jpeg-images-in-camera-raw-in-phot#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/rRFR8yQFM5U" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/how-to-open-jpeg-images-in-camera-raw-in-phot</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 23 Jul 2010 14:13:00 -0700</pubDate>
      <title>Change permissions on all directories except SVN with the command line?</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/LHcooU1CpXY/change-permissions-on-all-directories-except</link>
      <guid isPermaLink="false">http://davsblog.me/change-permissions-on-all-directories-except</guid>
      <description>&lt;p&gt;
	&lt;p&gt;OK, a quick one. Want to set permissions on all directories except &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;.svn&lt;/span&gt; ones?&lt;p /&gt;So, working from your current directory down, let's say you want to make all directories writeable, and leave the svn ones alone:&lt;p /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;find . -type d -not -name ".svn" | xargs chmod 0777&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Or, if you need to exclude several directory types, you could arrange it a little bit differently:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;find . -type d -print | grep -v '\(\.svn\|modules\)' | xargs chmod 0777&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/change-permissions-on-all-directories-except"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/change-permissions-on-all-directories-except#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/LHcooU1CpXY" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/change-permissions-on-all-directories-except</feedburner:origLink></item>
    <item>
      <pubDate>Fri, 23 Jul 2010 14:03:06 -0700</pubDate>
      <title>Victoria Memorial</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/UV2am-xzBpY/victoria-memorial</link>
      <guid isPermaLink="false">http://davsblog.me/victoria-memorial</guid>
      <description>&lt;p&gt;
	&lt;div class='p_embed p_image_embed'&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/mheVBeZ7PqpxoslIxDgXCqIZGjuOHZuabRMBIg0V7vXJaNkn6GW2XIdCCTfy/vicm.jpg.scaled.1000.jpg"&gt;&lt;img alt="Vicm" height="753" src="http://posterous.com/getfile/files.posterous.com/davez1000/v8741Fd0OQK5qnaItrNbNofqvSwNE6btRi1cVqeOJDfOLoXTA5XoN5Q5ZMrI/vicm.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Victoria Memorial, outside Buckingham Palace. Lucky the sky was filled with Cirrus clouds that day, it adds to the effect.&lt;p /&gt;Flickr page here:&lt;br /&gt;&lt;a href="http://bit.ly/9CTrTY"&gt;http://bit.ly/9CTrTY&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/victoria-memorial"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/victoria-memorial#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/UV2am-xzBpY" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/victoria-memorial</feedburner:origLink></item>
    <item>
      <pubDate>Sun, 18 Jul 2010 14:26:00 -0700</pubDate>
      <title>Downgrading to PHP 5.2 from PHP 5.3 on Ubuntu 10.04</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/qpSMDTcGpmk/downgrading-to-php-52-from-php-53-on-ubuntu-1</link>
      <guid isPermaLink="false">http://davsblog.me/downgrading-to-php-52-from-php-53-on-ubuntu-1</guid>
      <description>&lt;p&gt;
	&lt;p&gt;On the Ubuntu 10.04 Lucid Lynx release, by default PHP 5.3 is installed. Great if you are using it, but it's not for everyone. Definitely not for me being a Drupal developer, as for the moment, it causes problems.&lt;p /&gt; This method worked for me (however I am not responsible if it doesn't for you). All you need to do it put this lot in a shell file and run it. Remember to &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;chmod +x file&lt;/span&gt; for it to run.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;php_packages=`dpkg -l | grep php | awk '{print $2}'`&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo apt-get remove $php_packages&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo mkdir -p /etc/apt/preferences.d/&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;for package in $php_packages; &lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;do echo "Package: $package&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;Pin: release a=karmic&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;Pin-Priority: 991&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;" | sudo tee -a /etc/apt/preferences.d/php&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;done&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo apt-get update&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo apt-get install $php_packages&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo /etc/init.d/apache2 restart&lt;/span&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/downgrading-to-php-52-from-php-53-on-ubuntu-1"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/downgrading-to-php-52-from-php-53-on-ubuntu-1#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/qpSMDTcGpmk" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/downgrading-to-php-52-from-php-53-on-ubuntu-1</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 15 Jul 2010 16:47:00 -0700</pubDate>
      <title>Latest HDR's</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/cqh6ze7CkUo/latest-hdrs</link>
      <guid isPermaLink="false">http://davsblog.me/latest-hdrs</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Here are some of the most recent HDR shots I have taken.&lt;/p&gt;
&lt;p&gt;&lt;div class='p_embed p_image_embed'&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/iyKrNw1hJMRM9mtUT48WZJwc71yNgd7L6cKZRYmviXZ7dbkH8Nukh61HSoDH/4569119360_b556815ae6_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4569119360_b556815ae6_b" height="751" src="http://posterous.com/getfile/files.posterous.com/davez1000/mrze1vcchGRUTZkuFmUKHeaGnHoZDTc9IIUYIPRqnlamGxkEIrhCdj9yUACI/4569119360_b556815ae6_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/4esWFXmRB2bLnTdCUXl0Tz5JXYcGn9WTaOqqu7XTfgXZMHBfJjglbAaBnw1D/4736793190_5b63a9a65a_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4736793190_5b63a9a65a_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/PuWxpVBcqlxdKpupn7mGmXFzk8DdzSDL3huQQGLN8WZAWjc7kby4MFlB61Z1/4736793190_5b63a9a65a_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/uEfyVabjRQys3c5saTJVmbl47pOfnQyJ9TVd1yY9dT5K55iHQyzxPVOc7wMo/4578565295_cfec9b7124_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4578565295_cfec9b7124_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/LppLc0UCN01D1TZFbPpvLKIljcAH0Dk0HROLIcBhtZVpLZcKNftVA3RaEiJ3/4578565295_cfec9b7124_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/ROhHpG1vo67fqofDJYESWwUkzuYp1ATrAJPBmMVo881QvhZ2gOqn96bbPse6/4612509877_9eb0c5a48d_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4612509877_9eb0c5a48d_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/4HQKy54oKgqANPlJpROMb4qpBkZuX0aeYKFtRfbnye6VIXto37craZbOBGIa/4612509877_9eb0c5a48d_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/eLg8g2tr5fQ4oQdfnY64AsDDiKSNvp99iWqUhVPjrXHALn3cYmyRWoMoMLex/4616026399_c5e1815736_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4616026399_c5e1815736_b" height="333" src="http://posterous.com/getfile/files.posterous.com/davez1000/ir1BrTXxGZxdCKyy5vwWR3ClFfMuu9ZYumemzLobB5nGCulCSLJ7BCNngYlo/4616026399_c5e1815736_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/whRoBKHF3Fv2qNZVybIkMwKhOIirJ2o0vSrJr4yc19hCPDcFFBBjBs8zhNKr/4697985986_31049856ec_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4697985986_31049856ec_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/aWjHskDQim0P3mxdeo4kBGUxS3YybqUvweWxN5RQ2tYTHqJXiCN6q7P6vj1H/4697985986_31049856ec_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/wUp4kWLsApZn6Pj2eu0y5mCJyFBHwjOFjunXtfYlM65ANJxBeLVgvrdwwyLF/4698131738_62410392d0_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4698131738_62410392d0_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/duDzOC7TVZzs6VMJN0bV9mBhhYHIX889NQEiSJuDQZeTAI0rCVoLs0lcORRp/4698131738_62410392d0_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/PCVihaV4ltprYyVxDTtj4pcyI0EiWMIiMEDYLg79A1mvnHJyL2ycdqOeMhS1/4710158246_3ea309042f_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4710158246_3ea309042f_b" height="753" src="http://posterous.com/getfile/files.posterous.com/davez1000/9BpxHWopVZRKcPQ1kemeTeE80Eg5ijodhDsNJOFektFlbnelL86KYW9nmii6/4710158246_3ea309042f_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/xJlplH03omvJePKvFcsD9tOXEi9ZIbzdyVo3hL7MJ7Xwulpi2PAxxJ4LhBkj/4613455150_4bc3f3a208_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4613455150_4bc3f3a208_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/AQgPOIqOYtYYgvmkZ1K12HtFjTy9oXzGbBhMXdjz0eST9spo2iDDEnQZ2fYn/4613455150_4bc3f3a208_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;a href="http://posterous.com/getfile/files.posterous.com/davez1000/yl050ud5Qf8UU0AHYlNLWC2mRARZ6ECn54Wous8C1MusSXoDXP4v8eXHjuL5/4615710977_325c3af2ea_b.jpg.scaled.1000.jpg"&gt;&lt;img alt="4615710977_325c3af2ea_b" height="332" src="http://posterous.com/getfile/files.posterous.com/davez1000/VIsMgG2HQwJAQBriBNkYtuEPacfxuQkGfqVgowAPzVQnCuLEpoBdCVNZTCCo/4615710977_325c3af2ea_b.jpg.scaled.500.jpg" width="500" /&gt;&lt;/a&gt;
&lt;div class='p_see_full_gallery'&gt;&lt;a href="http://davsblog.me/latest-hdrs"&gt;See the full gallery on Posterous&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/latest-hdrs"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/latest-hdrs#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/cqh6ze7CkUo" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/latest-hdrs</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 15 Jul 2010 15:57:00 -0700</pubDate>
      <title>SVN URL shortcuts</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/g8KYm3yROmk/svn-url-shortcuts</link>
      <guid isPermaLink="false">http://davsblog.me/svn-url-shortcuts</guid>
      <description>&lt;p&gt;
	&lt;p&gt;Typing repository URL's are not fun in subversion, most of them are really long and if you want to commit multiple files or merge, sometimes you have to type them more than once.&lt;/p&gt;
&lt;div class="gmail_quote"&gt;&lt;br /&gt;If you run &lt;span style="font-family: courier new,monospace; color: #808080;"&gt;svn info&lt;/span&gt;, you will notice the line that begins with URL:&lt;p /&gt; Why don't we grab the contents of this line after the word &lt;span style="color: #ffff00;"&gt;URL:&lt;/span&gt; (so we are grabbing the URL itself), and put it in a shortcut.&lt;p /&gt;so, create an alias in your &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;.bashrc&lt;/span&gt; file:&lt;p /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;alias sitesvn="svn info | egrep '^URL: (.*)' | sed s/URL\:\ //"&lt;/span&gt;&lt;p /&gt; Now you can use a shortcut:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;svn ls $(sitesvn)/trunk&lt;/span&gt;&lt;p /&gt;&lt;br /&gt;Note: this might not work on *all* URL's, depending on how you have the SVN root setup.&lt;p /&gt; &lt;/div&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/svn-url-shortcuts"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/svn-url-shortcuts#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/g8KYm3yROmk" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/svn-url-shortcuts</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 15 Jul 2010 14:44:00 -0700</pubDate>
      <title>Posting to twitter from Ubuntu command line</title>
      <link>http://feedproxy.google.com/~r/DaveWasHere/~3/8a0dRz6-SEE/posting-to-twitter-from-ubuntu-command-line</link>
      <guid isPermaLink="false">http://davsblog.me/posting-to-twitter-from-ubuntu-command-line</guid>
      <description>&lt;p&gt;
	&lt;p&gt;If you are a real geek like me, you are the type of person that likes to do manually through the terminal rather than a graphical interface. The same goes for Twitter. I've tried loads of different twitter apps, some of them great, but it's fun sometimes posting from the command line.&lt;p /&gt; To set this up on Ubuntu, you will need to create a bash file with a twitter API command in:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo gedit /usr/bin/twitter&lt;/span&gt;&lt;p /&gt; Now enter this into the open 'twitter' file:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: #ffff00;" /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;echo SENT!&lt;/span&gt;&lt;p /&gt;(make sure to replace your username and yourpassword with your account username and password!)&lt;p /&gt;Save this file. Now we need to set permissions on the file we just created so we can run it:&lt;p /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;chmod +x /usr/bin/twitter&lt;/span&gt;&lt;p /&gt;And that's it. Now all you need to do, is actually post to Twitter. This is how:&lt;p /&gt;&lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;twitter "this is my new post message!"&lt;/span&gt;&lt;p /&gt; It will appear in Twitter as "from API", instead of "from Tweetdeck" or "from Echofon" or however else the tweets are posted.&lt;p /&gt;IF you get a message saying that curl is not installed when you try and post a tweet, then run this to install curl:&lt;p /&gt; &lt;span style="font-family: courier new,monospace; color: #ffff00;"&gt;sudo apt-get install curl&lt;/span&gt;&lt;/p&gt;
	
&lt;/p&gt;

&lt;p&gt;&lt;a href="http://davsblog.me/posting-to-twitter-from-ubuntu-command-line"&gt;Permalink&lt;/a&gt; 

	| &lt;a href="http://davsblog.me/posting-to-twitter-from-ubuntu-command-line#comment"&gt;Leave a comment&amp;nbsp;&amp;nbsp;&amp;raquo;&lt;/a&gt;

&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DaveWasHere/~4/8a0dRz6-SEE" height="1" width="1"/&gt;</description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/642250/me.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5BcmucvjP9dv</posterous:profileUrl>
        <posterous:firstName>Dave</posterous:firstName>
        <posterous:lastName>Brown</posterous:lastName>
        <posterous:nickName>davez1000</posterous:nickName>
        <posterous:displayName>Dave Brown</posterous:displayName>
      </posterous:author>
    <feedburner:origLink>http://davsblog.me/posting-to-twitter-from-ubuntu-command-line</feedburner:origLink></item>
  </channel>
</rss>

