<?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>justaddwater.dk &#187; Code</title>
	<atom:link href="http://justaddwater.dk/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://justaddwater.dk</link>
	<description>Instant Usability &#38; Web Standards</description>
	<lastBuildDate>Thu, 02 Feb 2012 08:51:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GWT Developer Plugin now Works with Firefox 9</title>
		<link>http://justaddwater.dk/2012/01/28/gwt-developer-plugin-now-works-with-firefox-9/</link>
		<comments>http://justaddwater.dk/2012/01/28/gwt-developer-plugin-now-works-with-firefox-9/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 13:38:44 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[gwt]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1562</guid>
		<description><![CDATA[(UPDATED) The GWT developer plugin has been updated to works with Firefox 9, a couple of days ago. Its not yet officially available, but can be downloaded directly from the codebase: google-web-toolkit.googlecode.com/svn/trunk/ prebuilt folder in here  is the gwt-dev-plugin.xpi, and it works like a charm :) Previously i wrote when the plugin was updated to [...]]]></description>
			<content:encoded><![CDATA[<p>(UPDATED) The GWT developer plugin has been updated to works with Firefox 9, a couple of days ago.</p>
<p>Its not yet officially available, but can be downloaded directly from the codebase:<br />
<a href="http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/">google-web-toolkit.googlecode.com/svn/trunk/ prebuilt folder</a> in here  is the <a href="http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi">gwt-dev-plugin.xpi</a>, and it works like a charm :)</p>
<p>Previously i wrote when the plugin was updated to <a href="http://justaddwater.dk/2011/10/10/gwt-developer-plugin-for-firefox-7-is-now-ready/">work with Firefox 7 and 8</a>.</p>
<p>More info in the group discussion: &#8220;<a href="https://groups.google.com/group/google-web-toolkit/browse_thread/thread/8d9d369fdbfdf87e/98f045c1eb38af0d#cdb775c291719219">GWT Developer Plugin for Firefox 9</a>&#8221;</p>
<p>What timing, as Mozilla is likely to release <a href="https://wiki.mozilla.org/Releases#Firefox_10">Firefox 10 this coming Tuesday</a>. For the sake of web developers that use GWT, i hope the plugin updates can come sooner in the future.</p>
<p>&nbsp;</p>
<p><strong>UPDATE 2012-02-02: This thread in the google group follows <a href="https://groups.google.com/group/google-web-toolkit/browse_thread/thread/2a259452c849c881#">plugin development for Firefox 10</a>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2012/01/28/gwt-developer-plugin-now-works-with-firefox-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch Screenshots with webkit2png</title>
		<link>http://justaddwater.dk/2012/01/23/batch-screenshots-with-webkit2png/</link>
		<comments>http://justaddwater.dk/2012/01/23/batch-screenshots-with-webkit2png/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:00:53 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1544</guid>
		<description><![CDATA[For projects I sometimes have lots of screenshots which I have to repeat whenever I change subtle things in the CSS or HTML. I ended up creating this little handy script based on webkit2png (download source) #!/usr/bin/env sh HOST="http://localhost:8080/myproject/viewer" /usr/bin/python webkit2png -F -o "01dashboard" $HOST/dashboard /usr/bin/python webkit2png -F -o "02showdetail" $HOST/detail /usr/bin/python webkit2png -F -o [...]]]></description>
			<content:encoded><![CDATA[<p>For projects I sometimes have lots of screenshots which I have to repeat whenever I change subtle things in the CSS or HTML.</p>
<p>I ended up creating this little handy script based on webkit2png (download source)</p>
<blockquote>
<pre>
<div>#!/usr/bin/env sh
HOST="http://localhost:8080/myproject/viewer"
/usr/bin/python webkit2png -F -o "01dashboard" $HOST/dashboard
/usr/bin/python webkit2png -F -o "02showdetail" $HOST/detail
/usr/bin/python webkit2png -F -o "03listpage" $HOST/list</div>
</pre>
</blockquote>
<div>This created the following 3 files in my directory:</div>
<blockquote>
<pre>
<div>$ ls -1
01dashboard.png
02showdetail.png
03listpage.png</div>
</pre>
</blockquote>
<div>Really simple and easy to use.</div>
<div>It only requires you to download webkit2png script (<a href="https://github.com/paulhammond/webkit2png">download on github</a>).</div>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2012/01/23/batch-screenshots-with-webkit2png/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maven mirrorOf * in settings.xml breaks the build</title>
		<link>http://justaddwater.dk/2012/01/20/maven-mirrorof-in-settings-xml-breaks-the-build/</link>
		<comments>http://justaddwater.dk/2012/01/20/maven-mirrorof-in-settings-xml-breaks-the-build/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 21:37:59 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[nexus]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1550</guid>
		<description><![CDATA[Using maven behind a firewall in environments with an internal repository can be troublesome, and even break the build. Here is an option to set up Maven]]></description>
			<content:encoded><![CDATA[<p>In our maven3 pom.xml files for a particular project, we have defined a reference to an internal Nexus repository. Since we are behind a firewall, the Nexus repository also has to be mirror of the outside world. I discovered that this <strong>generic &lt;mirrorOf&gt; from my settings.xml is actually evil</strong>:</p>
<blockquote>
<pre>&lt;!-- settings.xml --&gt;
&lt;mirrors&gt;
  &lt;mirror&gt;
    &lt;id&gt;insideFirewallRepo&lt;/id&gt;
    &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
    &lt;name&gt;Mirror of the world outside.&lt;/name&gt;
    &lt;url&gt;http://nexus_url/nexus/content/groups/public/&lt;/url&gt;
  &lt;/mirror&gt;
&lt;/mirrors&gt;</pre>
</blockquote>
<p>The reason for this being evil was our project pom files which had the following references</p>
<blockquote>
<pre>&lt;properties&gt;
  &lt;nexus.url&gt;http://nexus_url/nexus&lt;/nexus.url&gt;
  &lt;subversion.url&gt;http://svn_url/svn&lt;/subversion.url&gt;
&lt;/properties&gt;

  &lt;scm&gt;
    &lt;connection&gt;scm:svn:${subversion.url}/common-gwt-gui/trunk&lt;/connection&gt;
&lt;/scm&gt;

&lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;nexus-repo-releases&lt;/id&gt;
        &lt;name&gt;Nexus Repo&lt;/name&gt;
        &lt;url&gt;${nexus.url}/content/groups/public/&lt;/url&gt;
        &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/releases&gt;
        &lt;snapshots&gt; &lt;enabled&gt;false&lt;/enabled&gt; &lt;/snapshots&gt;
    &lt;/repository&gt;
    &lt;repository&gt;
        &lt;id&gt;nexus-repo-snapshots&lt;/id&gt;
        &lt;name&gt;Nexus Repo&lt;/name&gt;
        &lt;url&gt;${nexus.url}/content/groups/public-snapshots/&lt;/url&gt;
        &lt;releases&gt; &lt;enabled&gt;false&lt;/enabled&gt; &lt;/releases&gt;
        &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt;
    &lt;/repository&gt;
 &lt;/repositories&gt;</pre>
<pre>[repeat the &lt;repositories&gt; section for &lt;pluginRepositories&gt;]</pre>
</blockquote>
<div>And the same pom file contains the following &lt;distributionManagement&gt; section:</div>
<blockquote>
<pre>&lt;distributionManagement&gt;
    &lt;repository&gt;
        &lt;id&gt;company.releases&lt;/id&gt;
        &lt;url&gt;${nexus.url}/content/repositories/company/&lt;/url&gt;
    &lt;/repository&gt;
    &lt;snapshotRepository&gt;
        &lt;id&gt;company.snapshots&lt;/id&gt;
        &lt;url&gt;${nexus.url}/content/repositories/company-snapshots/&lt;/url&gt;
    &lt;/snapshotRepository&gt;
&lt;/distributionManagement&gt;</pre>
</blockquote>
<p>Finally we have the maven release-plugin, but this irrelevant for now:</p>
<blockquote>
<pre>&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;tagBase&gt;${subversion.url}/project_name/releases&lt;/tagBase&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
 &lt;/build&gt;</pre>
</blockquote>
<h2>Error message: Using the wrong repository for snapshots</h2>
<p>Now, the generic mirrorOf * in settings.xml actually overrides the specific repository information we set in the pom.xml. Because of that setting, the pom.xml &lt;repository&gt; is not used. And the result is an error message like this. (error message enhanced in bold)</p>
<blockquote>
<pre>Downloading: http://nexus_url/nexus/content/groups/public/com/company/dependency_project/1.18-SNAPSHOT/maven-metadata
.xml
Downloading: http://nexus_url/nexus/content/groups/public/com/company/dependency_project/1.18-SNAPSHOT/maven-metadata
.xml
Downloading: http://nexus_url/nexus/content/groups/public/com/company/dependency_project/1.18-SNAPSHOT/dependency_project
-1.18-SNAPSHOT.pom
[WARNING] The POM for com.company:dependency_project:jar:1.18-SNAPSHOT is missing, no dependency information available
Downloading: http://nexus_url/nexus/content/groups/public/com/company/dependency_project/1.18-SNAPSHOT/dependency_project
-1.18-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] project_name ...................................... FAILURE [1.108s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.364s
[INFO] Finished at: Fri Jan 20 12:28:04 CET 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project project_name: Could not resolve dependencies for project com.company:project_name:jar:2.1.1
3-SNAPSHOT: Could not find artifact com.company:dependency_project:jar:1.18-SNAPSHOT in <strong>insideFirewallRepo (http://nexus_url
/nexus/content/groups/public/</strong>) -&gt; [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn &lt;goals&gt; -rf :project_name</pre>
</blockquote>
<blockquote>
<pre>Notice that the errormessage actually gave the ID of our &lt;mirror&gt; from settings.xml:
&lt;!-- settings.xml --&gt;
 &lt;mirrors&gt;
   &lt;mirror&gt;
     &lt;id&gt;<strong>insideFirewallRepo</strong>&lt;/id&gt;</pre>
</blockquote>
<div>So problem is that maven actually does not use the pom.xml settings, but we can easily fix this.</div>
<div></div>
<div>Solution: Exclude local repositories from mirrorOf *</div>
<div></div>
<div>We need to force Maven to use the &lt;repository&gt; values from the project pom.xml. And  maven can do just that, since we need to take the &lt;repository&gt; ids and exclude them from mirrorOf *.</div>
<div></div>
<div>Take the repository ids from the pom file:</div>
<blockquote>
<pre>&lt;repositories&gt;
&lt;repository&gt;&lt;id&gt;<strong>nexus-repo-releases</strong>&lt;/id&gt;&lt;repository&gt;
&lt;repository&gt;&lt;id&gt;<strong>nexus-repo-snapshots</strong>&lt;/id&gt;&lt;repository&gt;</pre>
</blockquote>
<div>And exclude them to mirrorOf in settings.xml (add an exclamation mark in front of them). Line added enhanced in bold:</div>
<blockquote>
<pre>&lt;!-- settings.xml --&gt;
&lt;mirrors&gt;
  &lt;mirror&gt;
    &lt;id&gt;insideFirewallRepo&lt;/id&gt;
    &lt;mirrorOf&gt;<strong>!nexus-repo-releases,!nexus-repo-snapshots,*</strong>&lt;/mirrorOf&gt;
    &lt;name&gt;Mirror of the world outside.&lt;/name&gt;
    &lt;url&gt;http://nexus_url/nexus/content/groups/public/&lt;/url&gt;
  &lt;/mirror&gt;
&lt;/mirrors&gt;</pre>
</blockquote>
<p>Most users could probably just remove the &lt;mirrors&gt; block from settings.xml, but in this particular project, that is not possible since firewall blocks for access to maven central. So, in order for us to use external dependencies, we must use the &lt;mirror&gt; in settings.xml</p>
<p>Then, you could argue, to use &lt;proxy&gt; instead of &lt;mirrors&gt; in settings.xml. This may be a decent solution as well, but in my case i wanted to avoid that, since the company proxy required user/password. Our jenkins build machines would then have my username/password, and it would lock my account whenever my password expires.</p>
<p>Within those constraints, the &lt;mirror&gt; block with excluded internal repositories seems like a decent fit.</p>
<p>For the issues described in this article, I have been using Maven 3.0.3 and Sonatype Nexus 1.9.2</p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2012/01/20/maven-mirrorof-in-settings-xml-breaks-the-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IntelliJ Structural Search to Convert from JUnit3 to Junit4</title>
		<link>http://justaddwater.dk/2012/01/18/intellij-structural-search-to-convert-from-junit3-to-junit4/</link>
		<comments>http://justaddwater.dk/2012/01/18/intellij-structural-search-to-convert-from-junit3-to-junit4/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 12:37:24 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1541</guid>
		<description><![CDATA[Just a quick tip for intellij users. For an old project i wanted to convert JUnit 3 testcases to JUnit4 format. Most stuff was already in place, but after the conversion, i found that some of the old &#8220;assertTrue&#8221;, &#8220;assertFalse&#8221;, and &#8220;assertEquals&#8221; statements were failing. So i ended up with some short search/replace, which are really [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick tip for intellij users. For an old project i wanted to convert JUnit 3 testcases to JUnit4 format. Most stuff was already in place, but after the conversion, i found that some of the old &#8220;assertTrue&#8221;, &#8220;assertFalse&#8221;, and &#8220;assertEquals&#8221; statements were failing.</p>
<p>So i ended up with some short search/replace, which are really handy in IntelliJ.</p>
<h2>Replace &#8220;assertTrue&#8221; and &#8220;assertFalse&#8221; with &#8220;assertThat&#8221;</h2>
<p>Search template</p>
<blockquote>
<pre>assertTrue($msg$, $actual$);</pre>
</blockquote>
<p>Replacement template:</p>
<blockquote>
<pre>org.junit.Assert.assertThat.assertThat($msg$, $actual$, org.hamcrest.core.Is.is(true));</pre>
</blockquote>
<h2>Remove &#8220;assertEquals&#8221; with delta values</h2>
<p>Search template</p>
<blockquote>
<pre>assertEquals($msg$, $expected$, $actual$, $delta$);</pre>
</blockquote>
<p>Replacement template:</p>
<blockquote>
<pre>org.junit.Assert.assertThat($msg$, $actual$, org.hamcrest.core.Is.is($expected$));</pre>
</blockquote>
<h2>Optional Replace &#8220;assertEquals&#8221; with &#8220;assertThat&#8221;</h2>
<p>Search template</p>
<blockquote>
<pre>assertEquals($msg$, $expected$, $actual$);</pre>
</blockquote>
<p>Replacement template:</p>
<blockquote>
<pre>org.junit.Assert.assertThat.assertThat($msg$, $actual$, org.hamcrest.core.Is.is($expected$));</pre>
</blockquote>
<p><a href="http://justaddwater.dk/wp-content/uploads/2012/01/intellij-structural-search-assertequals-replace-by-assertThat.png"><img class="aligncenter size-medium wp-image-1542" title="intellij-structural-search-assertequals-replace-by-assertThat" src="http://justaddwater.dk/wp-content/uploads/2012/01/intellij-structural-search-assertequals-replace-by-assertThat-300x247.png" alt="" width="300" height="247" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2012/01/18/intellij-structural-search-to-convert-from-junit3-to-junit4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GWT Developer plugin for Firefox 7 is now Ready</title>
		<link>http://justaddwater.dk/2011/10/10/gwt-developer-plugin-for-firefox-7-is-now-ready/</link>
		<comments>http://justaddwater.dk/2011/10/10/gwt-developer-plugin-for-firefox-7-is-now-ready/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 22:18:42 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[gwt]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1531</guid>
		<description><![CDATA[UPDATED 2011-12-14: Prebuilt folder now contains Firefox 8 version of the GWT developer plugin. Since Firefox 7 was released, i have defered upgrading for one simple reason: At work I am dependent on GWT Developer plugin. Today I found the ready-to-release plugin which actually works with Firefox 7: http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/ in here  is the gwt-dev-plugin.xpi, and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATED 2011-12-14:</strong> <a href="http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/">Prebuilt</a> folder now contains Firefox 8 version of the GWT developer plugin.</p>
<p>Since Firefox 7 was released, i have defered upgrading for one simple reason: At work I am dependent on GWT Developer plugin.</p>
<p>Today I found the ready-to-release plugin which actually works with Firefox 7:</p>
<p><a href="http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/">http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/</a> in here  is the <a href="http://google-web-toolkit.googlecode.com/svn/trunk/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi">gwt-dev-plugin.xpi</a>, and it works like a charm :)</p>
<p>(In firefox, it asks you to download. And then you can drag the downloaded .xpi back into the browser to install. Why Firefox will not instantly recognize the .xpi file is kind of strange)</p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2011/10/10/gwt-developer-plugin-for-firefox-7-is-now-ready/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Collection of useful Git Tips to get started</title>
		<link>http://justaddwater.dk/2011/09/30/collection-of-useful-git-tips-to-get-started/</link>
		<comments>http://justaddwater.dk/2011/09/30/collection-of-useful-git-tips-to-get-started/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 18:44:17 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1520</guid>
		<description><![CDATA[I thought it was time to collect some of my most useful findings when working with Git. These are typically from situations where I found a useful way, which I wanted to jot down. Also I have answered and asked some questions on StackOverflow. The good thing about it, is that I am always able [...]]]></description>
			<content:encoded><![CDATA[<p>I thought it was time to collect some of my most useful findings when working with Git.</p>
<p>These are typically from situations where I found a useful way, which I wanted to jot down. Also I have answered and asked some questions on StackOverflow. The good thing about it, is that I am always able to find it again this way.</p>
<p>Justaddwater.dk posts:</p>
<ol>
<li><a title="Permanent Link to How to make Git ignore files that already exist in your project" rel="bookmark" href="http://justaddwater.dk/2009/12/07/how-to-make-git-ignore-files-that-already-exist-in-your-project/">How to make Git ignore files that already exist in your project</a></li>
<li><a title="Permanent Link to Spoken Git Commit Log — Another Annoyance at the Office" rel="bookmark" href="http://justaddwater.dk/2009/09/30/spoken-git-commit-log-%e2%80%94-another-annoyance-at-the-office/">Spoken Git Commit Log — Another Annoyance at the Office</a></li>
<li><a title="Permanent Link to How to add Git Pull Shortcut to Different Github Branches" rel="bookmark" href="http://justaddwater.dk/2009/08/23/how-to-add-git-pull-shortcut-to-different-github-branches/">How to add Git Pull Shortcut to Different Github Branches</a></li>
<li><a title="Permanent Link to Using Git for SVN Repositories Workflow" rel="bookmark" href="http://justaddwater.dk/2009/03/09/using-git-for-svn-repositories-workflow/">Using Git for SVN Repositories Workflow</a></li>
<li><a title="Permanent Link to Using Local File-based Git — Server Laziness" rel="bookmark" href="http://justaddwater.dk/2009/02/21/using-local-file-based-git-server-laziness/">Using Local File-based Git — Server Laziness</a></li>
</ol>
<p>StackOverflow posts:</p>
<ol>
<li><a href="http://stackoverflow.com/questions/266395/git-svn-how-do-i-create-a-new-svn-branch-via-git/1911069#1911069">git-svn: how do I create a new svn branch via git?</a></li>
<li><a href="http://stackoverflow.com/questions/728931/how-to-switch-svn-branches-using-git-svn">How to switch svn branches using git-svn?</a></li>
<li><a title="I created a local branch which I want to 'push' upstream. There is a similar question here on Stackoverflow on how to track a newly created remote branch.   However, my workflow is slightly different. ..." href="http://stackoverflow.com/questions/1519006/git-how-to-create-remote-branch">Git how to create remote branch</a></li>
<li><a title="I accidentally amended my previous commit. The commit should have been separate to keep history of the changes I made to a particular file.  Is there a way to undo that last commit? If I do something ..." href="http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit">How to undo “git commit &#8211;amend” done instead of “git commit”</a></li>
<li><a title="In a Git code repository I want to list all commits that contain a certain word  I tried this:     git log -p | grep --context=4 &quot;word&quot;  but it does not necessarily give me back the filename (unless ..." href="http://stackoverflow.com/questions/1337320/how-to-grep-git-commits-for-a-certain-word">How to grep git commits for a certain word</a></li>
<li><a title="I often have the case that I want to work on a SVN repository right away. But an ordinary git svn clone [url] also clones the entire history. So I want to speed things up. The first part is to fetch ..." href="http://stackoverflow.com/questions/1554222/git-svn-clone-how-to-defer-fetch-of-revision-history">Git svn clone: How to defer fetch of revision history</a></li>
<li><a title="Previously I have enjoyed TortoiseSvn's ability to generate simple commit stats for a given SVN repository. I wonder what is available in Git and am particularly interested in :   Number of commits ..." href="http://stackoverflow.com/questions/1486819/which-git-commit-stats-are-easy-to-pull">Which Git commit stats are easy to pull</a></li>
<li><a title="I really like the short git log format where I can see author, date and change description like this:  git log --pretty=format:&quot;%h%x09%an%x09%ad%x09%s&quot;   Which outputs:    fbc3503 mads    Thu Dec 4 ..." href="http://stackoverflow.com/questions/1441156/git-how-to-save-a-preset-git-log-format">Git how to save a preset git log &#8211;format</a></li>
<li><a title="For deploying to Heroku, I use git push heroku master. But how do I see which revision I pushed up to heroku? (I'm often in doubt if I pushed the recent version up)  For those not familiar with it, ..." href="http://stackoverflow.com/questions/2281772/view-remote-git-revision-on-heroku">View remote Git revision on Heroku</a></li>
<li><a title="How can I show a git log output with (at least) this information:  * author * commit date * change  I want it compressed to one line per log entry. What's the shortest possible format for that?  ..." href="http://stackoverflow.com/questions/1441010/the-shortest-possible-output-from-git-log-containing-author-and-date">The shortest possible output from git log containing author and date</a></li>
<li><a title="I am about to create a patch file for a project. My branch is the &quot;master&quot; in my local repository. And the remote upstream branch is mapped to the local branch &quot;origin&quot;. \ With this command I can ..." href="http://stackoverflow.com/questions/1873400/git-how-to-find-out-which-single-commits-that-done-on-one-branch-and-not-another">Git how to find out which single commits that done on one branch and not another</a></li>
</ol>
<ol></ol>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2011/09/30/collection-of-useful-git-tips-to-get-started/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Java Friday Fun: @WTF annotations in code</title>
		<link>http://justaddwater.dk/2011/09/16/java-friday-fun-wtf-annotations-in-code/</link>
		<comments>http://justaddwater.dk/2011/09/16/java-friday-fun-wtf-annotations-in-code/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 20:52:08 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1492</guid>
		<description><![CDATA[Time for a little geeky gimmick. Some developers see and express a lot of &#8220;WTF??&#8221; while trying to understand code IN this spirit, i created a quick @WTF annotation for Java. Besides being completely useless (its removed at compile time), its only purpose is to give developers a new way to express themselves in code. [...]]]></description>
			<content:encoded><![CDATA[<p>Time for a little geeky gimmick. Some developers see and express a lot of &#8220;WTF??&#8221; while trying to understand code</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2011/09/focus-shift-cartoon-wtf-per-minute-wtfm.jpg"><img class="aligncenter size-medium wp-image-1493" title="focus-shift-cartoon-wtf-per-minute-wtfm" src="http://justaddwater.dk/wp-content/uploads/2011/09/focus-shift-cartoon-wtf-per-minute-wtfm-300x282.jpg" alt="" width="300" height="282" /></a></p>
<p>IN this spirit, i created a quick @WTF annotation for Java.</p>
<p>Besides being completely useless (its removed at compile time), its only purpose is to give developers a new way to express themselves in code.</p>
<p><script src="https://gist.github.com/1222965.js?file=WTF.java"></script></p>
<p>The cartoon states &#8220;The only valid measurement of code quality: WTFs/minute&#8221;. With the &lt;code&gt;@WTF&lt;/code&gt; annotations, I would like to take it a little further. By annotating the code, you can actually encourage colleagues to help you fix it.</p>
<p>The best fix for WTF-code is of course to refactor, so that it becomes readable.</p>
<p>Interesting article:</p>
<p><a href="http://www.gridshore.nl/2008/03/29/how-wtfs-improve-code-quality-awareness/">http://www.gridshore.nl/2008/03/29/how-wtfs-improve-code-quality-awareness/</a></p>
<p>The original cartoon strip:  <a href="http://www.osnews.com/story/19266/WTFs_m">http://www.osnews.com/story/19266/WTFs_m</a></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2011/09/16/java-friday-fun-wtf-annotations-in-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Windows delete all tmp files command</title>
		<link>http://justaddwater.dk/2011/07/12/windows-delete-all-tmp-files-command/</link>
		<comments>http://justaddwater.dk/2011/07/12/windows-delete-all-tmp-files-command/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 20:34:10 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1419</guid>
		<description><![CDATA[Just a quick note to self about this tip i found. It is a Windows (XP) helpful command line snippet that removes all your temporary files. Delete all files in temp folder: DEL /F /S /Q %TEMP% Taken from the &#8220;A-Z Index of the Windows CMD command line&#8221;]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to self about this tip i found. It is a Windows (XP) helpful command line snippet that removes all your temporary files.</p>
<p>Delete all files in temp folder:</p>
<blockquote><pre>DEL /F /S /Q %TEMP%</pre>
</blockquote>
<p>Taken from the &#8220;<a href="http://ss64.com/nt/del.htm">A-Z Index of the Windows CMD command line</a>&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2011/07/12/windows-delete-all-tmp-files-command/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Windows SVN pre-commit-hook</title>
		<link>http://justaddwater.dk/2010/06/10/windows-svn-pre-commit-hook/</link>
		<comments>http://justaddwater.dk/2010/06/10/windows-svn-pre-commit-hook/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 08:23:32 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1354</guid>
		<description><![CDATA[At a current project I work on, we use a Windows server to run our subversion repository. I wanted to set up the pre-commit hook so that commits with empty comment are automatically rejected. All commit-hook example files that go with Subversion are written in bash (as unix servers tend to be the normal). Here [...]]]></description>
			<content:encoded><![CDATA[<p>At a current project I work on, we use a Windows server to run our subversion repository. </p>
<p>I wanted to set up the pre-commit hook so that commits with empty comment are automatically rejected.</p>
<p>All commit-hook example files that go with Subversion are written in bash (as unix servers tend to be the normal). </p>
<p>Here is a the pre-commit hook rewritten as a windows .bat file.</p>
<p><script src="http://gist.github.com/432704.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2010/06/10/windows-svn-pre-commit-hook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Seeding Rails App With RESTful Address Data</title>
		<link>http://justaddwater.dk/2010/04/28/seeding-rails-app-with-restful-address-data/</link>
		<comments>http://justaddwater.dk/2010/04/28/seeding-rails-app-with-restful-address-data/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 10:55:26 +0000</pubDate>
		<dc:creator>Jesper Rønn-Jensen</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1341</guid>
		<description><![CDATA[Grabbing data from Restful webservices has never been easier. I use this code in the Rails /db/seeds.rb file to grab data from the Danish webservice with addresses, municipalities, regions, etc. I decided to import the data into a local database to ensure it could work offline. Code from /db/seeds.rb file: Now I can access municipalities [...]]]></description>
			<content:encoded><![CDATA[<p>Grabbing data from Restful webservices has never been easier. I use this code in the Rails /db/seeds.rb file to grab data from the Danish webservice with addresses, municipalities, regions, etc.</p>
<p>I decided to import the data into a local database to ensure it could work offline.</p>
<p>Code from
<div class="codesnip-container" >/db/seeds.rb</div>
<p> file:</p>
<p><script src="http://gist.github.com/382105.js"></script></p>
<p>Now I can access municipalities in a grouped selectbox like so in the view code:</p>
<pre>
<div class="codesnip-container" >&lt;%
 options = option_groups_from_collection_for_select(Region.all, :kommuner, :name, :id, :name)
%&gt;

&lt;%=
 f.select("kommune_id", options, {}, {:class =&gt; "short"})
%&gt;</div>
</pre>
<p>The final result rendered in the user interface:<br />
<img src="http://justaddwater.dk/wp-content/uploads/2010/04/Screen-shot-2010-04-28-at-3.18.06-PM.png" alt="" title="Rails rendered optgroup selectbox" width="286" height="253" class="aligncenter size-full wp-image-1343" /></p>
<p>This code is based on Rails 2.3.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://justaddwater.dk/2010/04/28/seeding-rails-app-with-restful-address-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

