<?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</title>
	<atom:link href="http://justaddwater.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://justaddwater.dk</link>
	<description>Instant Usability &#38; Web Standards</description>
	<lastBuildDate>
	Wed, 02 Nov 2016 19:50:55 +0000	</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.1.22</generator>
	<item>
		<title>Git extract folder from project with history and tags</title>
		<link>http://justaddwater.dk/2016/11/02/git-extract-folder-from-project-with-history-and-tags/</link>
				<comments>http://justaddwater.dk/2016/11/02/git-extract-folder-from-project-with-history-and-tags/#comments</comments>
				<pubDate>Wed, 02 Nov 2016 19:40:32 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1809</guid>
				<description><![CDATA[`git filter-branch` will extract a folder from a shared repository and rewrite history. This tip shows you by example. And also how to rewrite tags in the new repos.]]></description>
								<content:encoded><![CDATA[<p>This is a short note regarding the use of `git filter-branch` when you want to split a git repository and preserve the history.</p>
<p>I had some issues in finding the correct parameters. In case this also can help others, you can find the command here.</p>
<p>In case you are not yet familiar with the possibilities of `git filter-branch`, I suggest you look into the  <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#The-Nuclear-Option:-filter-branch">Git book: Rewriting history</a>, which has a good introduction to the command.</p>
<p>Now, to start you should clone the repository you want to change (since you will completely rewrite history in the new repos).</p>
<p>&nbsp;</p>
<p>In short, without further explanation:</p>
<p><code>ORIG=path_to_original_repos<br />
DEST=destination_of_rewritten_repos<br />
DIR=directory_you_want_to_extract_from_ORIG</p>
<p>git clone $ORIG $DEST &amp;&amp; \<br />
cd $DEST &amp;&amp; \<br />
git filter-branch --prune-empty --tag-name-filter cat --subdirectory-filter $DIR -- --all</code></p>
<p>A few notes:</p>
<ul>
<li><code>--prune-empty</code> will remove all commits that has no relation to the folder you extract</li>
<li><code>--tag-name-filter cat</code> will also rewrite any tags you put on the commits that are rewritten</li>
<li><code>--subdirectory-filter</code> takes a foldername as parameter, but I needed to add <code>-- --all</code> to make it work</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>http://justaddwater.dk/2016/11/02/git-extract-folder-from-project-with-history-and-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>Git tip to remove remote branches already merged</title>
		<link>http://justaddwater.dk/2016/08/25/git-tip-to-remove-remote-branches-already-merged/</link>
				<pubDate>Thu, 25 Aug 2016 09:54:43 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1798</guid>
				<description><![CDATA[Let&#8217;s talk about source control and an efficient way of using Git. I like the projects where you have a `master` branch and a few feature branches, which are actively being worked upon. Only a few branches are present at a given time, and this is less confusing for the contributors in the repository. A [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Let&#8217;s talk about source control and an efficient way of using Git.</p>
<p>I like the projects where you have a `master` branch and a few feature branches, which are actively being worked upon. Only a few branches are present at a given time, and this is less confusing for the contributors in the repository.</p>
<p>A couple of times I have been on a project where old branches were not cleaned up. </p>
<p>I found that it&#8217;s really easy to list these branches and clean them up.</p>
<p>Step 1: List all branches that are already merged:</p>
<p><code>$ git branch -r --merged</code></p>
<p>Lists all remote branches which are already merged. In case you want to find the old ones, you can sort them by commit date with the flag `&#8211;sort=committerdate`</p>
<p>Example:</p>
<p><code>$ git branch -r --sort committerdate</code></p>
<p>Committerdate flag will put the most recent branches last (you can reverse with minus: `<code>--sort=-committerdate</code>`.</p>
<p>Step 2: List only relevant branches.</p>
<p>The list returned from above will also contain origin/HEAD and origin/master with we have to filter out:</p>
<p><code>$ git branch -r --merged | cut -d / -f 2 | grep -v master | grep -v origin</code></p>
<p>we simply remove them with `grep -v`</p>
<p>Step 3: Feed list into a delete command</p>
<p>The above command will give you a list of branches to remove. Review the list carefully by printing each line:</p>
<p><code>$ git branch -r --merged | cut -d / -f 2 | grep -v master | grep -v origin | xargs -n 1 echo</code></p>
<p>When you are satisfied, you can remove each branch with a git push command. Example</p>
<p><code>$ git push --delete origin merged_branch1</code></p>
<p>You can simply repeat this for as many times as you have branches with the above expression. So, in total your final command will be:</p>
<p><code>$ git branch -r --merged | cut -d / -f 2 | grep -v master | grep -v origin | xargs -n 1  git push --delete origin</code></p>
<p>And done :)</p>
<p>This post is following my series of blog posts with <a href="http://justaddwater.dk/2011/09/30/collection-of-useful-git-tips-to-get-started/">useful Git Tips</a></p>
]]></content:encoded>
										</item>
		<item>
		<title>Ruby make list minimum length</title>
		<link>http://justaddwater.dk/2015/12/13/ruby-make-list-minimum-length/</link>
				<comments>http://justaddwater.dk/2015/12/13/ruby-make-list-minimum-length/#comments</comments>
				<pubDate>Sun, 13 Dec 2015 20:20:01 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1781</guid>
				<description><![CDATA[In a Ruby on Rails app, I wanted a list to be at least of two items. This could be done in several ways. Here is a first naïve impementation: # Naïve implementation, just return whatever number I need def sum_up_a(existing) return 2 if existing == 0 return 1 if existing == 1 return 0 end [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>In a Ruby on Rails app, I wanted a list to be at least of two items. This could be done in several ways.</p>
<p>Here is a first naïve impementation:</p>
<pre><code>
# Naïve implementation, just return whatever number I need
def sum_up_a(existing)
  return 2 if existing == 0
  return 1 if existing == 1
  return 0
end

sum_up_a(0)   # =&gt; 2
sum_up_a(1)   # =&gt; 1
sum_up_a(2)   # =&gt; 0
sum_up_a(3)   # =&gt; 0
sum_up_a(10)  # =&gt; 0

</code></pre>
<p>A slightly improved version could investigate number of existing, and return the diff only if needed:</p>
<pre><code>
MIN_COUNT = 2
# slightly improved with less conditionals
def sum_up_b(existing)
  return 0 if existing &gt;= MIN_COUNT
  MIN_COUNT - existing
end

sum_up_b(0)   # =&gt; 2
sum_up_b(1)   # =&gt; 1
sum_up_b(2)   # =&gt; 0
sum_up_b(3)   # =&gt; 0
sum_up_b(10)  # =&gt; 0
</code></pre>
<p>&nbsp;</p>
<p>Now, my favourite. If you look at the result of &#8220;MIN_COUNT &#8211; existing&#8221;. This number is negative or zero if we dont want extra rows. This means that we can rewrite the algorithm without any conditional logic like this:</p>
<pre><code>
# my favorite: return the biggest number either 0 or the difference
# Works well because difference is only positive for numbers where I 
# need some extra rows
def sum_up_c(existing)
  [MIN_COUNT - existing, 0].max 
end

sum_up_c(0)   # =&gt; 2
sum_up_c(1)   # =&gt; 1
sum_up_c(2)   # =&gt; 0
sum_up_c(3)   # =&gt; 0
sum_up_c(10)  # =&gt; 0
</code></pre>
<p>I like the latter, since too many conditional statements tend to clutter the logic. Just a short tip and a reminder for myself next time I run into this kind of problem.</p>
<p>&nbsp;</p>
<p>Complete example gist avalilable on Github:</p>
<p><script src="https://gist.github.com/jesperronn/8c5fe0d78f77adc7320f.js"></script></p>
]]></content:encoded>
							<wfw:commentRss>http://justaddwater.dk/2015/12/13/ruby-make-list-minimum-length/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
							</item>
		<item>
		<title>Change history of SVN repository</title>
		<link>http://justaddwater.dk/2015/04/15/change-history-of-svn-repository/</link>
				<pubDate>Wed, 15 Apr 2015 22:06:48 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1759</guid>
				<description><![CDATA[Somebody asked me if it&#8217;s possible to change history of an SVN repository like you can do in Git. The easiest parts to change are: commit date commit log message With this, you can easily modify time stamps if, for instance, your svn server clock is wrong. Step 1: Modify repository to accept property changes [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Somebody asked me if it&#8217;s possible to change history of an SVN repository like you can do in Git.</p>
<p>The easiest parts to change are:</p>
<ul>
<li>commit date</li>
<li>commit log message</li>
</ul>
<p>With this, you can easily modify time stamps if, for instance, your svn server clock is wrong.</p>
<h2>Step 1: Modify repository to accept property changes</h2>
<p>Make sure your svn repository accepts property changes. (commit dates and messages are just properties which are basically unversioned).</p>
<p>For your repository, you need to make sure the hook file `pre-revprop-change` exists, is executable and has exit code 0. An easy way is to write a file which always exists with code 0:</p>
<p># write this file to `repository_directory/hooks/pre-revprop-change`</p>
<blockquote>
<pre>#!/usr/bin/env sh</pre>
<pre>exit 0</pre>
</blockquote>
<h2> Step 2: change date on the revision you want:</h2>
<p>In this example I will set the date for revision 1 to May 1st, 1981.</p>
<blockquote>
<pre>svn propset --revprop -r 1 svn:date <span class="pl-s1"><span class="pl-pds">"1981</span>-05-01T10:00:00.000000Z<span class="pl-pds">"</span></span></pre>
</blockquote>
<p>`svn propset` command will set certain properties. You can set many properties, and in this example we manipulate `svn:date`. If we want to change the log message, we can use `svn:log`.</p>
<p>I deliberately chose a date from before SVN was made. Subversion is from 2001, so this commit is now made 20 years before SVN was out.</p>
<h2>All combined</h2>
<p>I created a combined script, which has has the steps mentioned above, and also iterates to change all dates in a repository:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3><script src="https://gist.github.com/jesperronn/174cea58433d2f06968f.js"></script>The result</h3>
<p>The result is a fine modified commit history which could look like this</p>
<blockquote>
<pre>$ svn log


</pre>
<p class="p1"><span class="s1">r10 | jesper | 1990-05-01 12:00:00 +0200 (Tue, 01 May 1990) | 1 line<br />
</span>commit number 10 (originally created 2015-04-15 22:21:35)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r9 | jesper | 1989-05-01 12:00:00 +0200 (Mon, 01 May 1989) | 1 line<br />
commit number 9 (originally created 2015-04-15 22:21:34)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r8 | jesper | 1988-05-01 12:00:00 +0200 (Sun, 01 May 1988) | 1 line<br />
commit number 8 (originally created 2015-04-15 22:21:33)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r7 | jesper | 1987-05-01 12:00:00 +0200 (Fri, 01 May 1987) | 1 line<br />
commit number 7 (originally created 2015-04-15 22:21:32)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r6 | jesper | 1986-05-01 12:00:00 +0200 (Thu, 01 May 1986) | 1 line<br />
commit number 6 (originally created 2015-04-15 22:21:31)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r5 | jesper | 1985-05-01 12:00:00 +0200 (Wed, 01 May 1985) | 1 line<br />
commit number 5 (originally created 2015-04-15 22:21:30)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r4 | jesper | 1984-05-01 12:00:00 +0200 (Tue, 01 May 1984) | 1 line<br />
commit number 4 (originally created 2015-04-15 22:21:29)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r3 | jesper | 1983-05-01 12:00:00 +0200 (Sun, 01 May 1983) | 1 line<br />
commit number 3 (originally created 2015-04-15 22:21:28)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r2 | jesper | 1982-05-01 12:00:00 +0200 (Sat, 01 May 1982) | 1 line<br />
commit number 2 (originally created 2015-04-15 22:21:27)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
r1 | jesper | 1981-05-01 12:00:00 +0200 (Fri, 01 May 1981) | 1 line<br />
commit number 1 (originally created 2015-04-15 22:21:26)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
</blockquote>
<h2><span style="line-height: 1.5;">More info</span></h2>
<ul>
<li>SVN book <a href="http://svnbook.red-bean.com/en/1.7/svn.ref.reposhooks.pre-revprop-change.html">chapter on &#8220;pre-revprop-change&#8221;</a></li>
<li>Rooot.net &#8220;<a href="http://www.rooot.net/en/development/code/16-change-svn-commit-log-date.html">Change a SVN commit log message or date</a>&#8220;</li>
<li>Stackoverflow: <a class="question-hyperlink" href="http://stackoverflow.com/questions/692851/can-i-go-back-and-edit-comments-on-an-svn-checkin">Can I go back and edit comments on an SVN checkin?</a></li>
<li>Stackoverflow: <a class="question-hyperlink" href="http://stackoverflow.com/questions/633353/change-the-timestamp-of-a-svn-revision">Change the timestamp of a SVN revision</a></li>
</ul>
]]></content:encoded>
										</item>
		<item>
		<title>Easter egg CSS circles</title>
		<link>http://justaddwater.dk/2015/03/29/easter-egg-css-circles/</link>
				<comments>http://justaddwater.dk/2015/03/29/easter-egg-css-circles/#comments</comments>
				<pubDate>Sun, 29 Mar 2015 18:49:11 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1747</guid>
				<description><![CDATA[Easter eggs instead of circles on your CSS. It's easier than I thought.

<img class="aligncenter size-full wp-image-1752" src="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-with-easter-eggs-css-cropped.png" alt="screenshot-with-easter-eggs-css-cropped" width="168" height="96" />]]></description>
								<content:encoded><![CDATA[<p>We are approaching easter, and I couldn&#8217;t resist to make eggs on the project I am working on these days:</p>
<p>Now:</p>
<p>&nbsp;</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-with-easter-eggs.png"><img class="aligncenter size-medium wp-image-1748" src="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-with-easter-eggs-300x222.png" alt="screenshot-with-easter-eggs" width="300" height="222" srcset="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-with-easter-eggs-300x222.png 300w, http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-with-easter-eggs.png 380w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Before</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-without-easter-eggs.png"><img class="aligncenter size-medium wp-image-1749" src="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-without-easter-eggs-300x194.png" alt="screenshot-without-easter-eggs" width="300" height="194" srcset="http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-without-easter-eggs-300x194.png 300w, http://justaddwater.dk/wp-content/uploads/2015/03/screenshot-without-easter-eggs.png 376w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>The trick is really easy. CSS border radius can be applied in ellipsis shapes. Each corner has a  vertical and a horizontal radius. So you really just have to change the vertical radius of each corner like this:</p>
<p>&nbsp;</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2015/03/Screen-Shot-2015-03-27-at-09.59.44.png"><img class="aligncenter size-medium wp-image-1750" src="http://justaddwater.dk/wp-content/uploads/2015/03/Screen-Shot-2015-03-27-at-09.59.44-300x99.png" alt="Screen Shot 2015-03-27 at 09.59.44" width="300" height="99" srcset="http://justaddwater.dk/wp-content/uploads/2015/03/Screen-Shot-2015-03-27-at-09.59.44-300x99.png 300w, http://justaddwater.dk/wp-content/uploads/2015/03/Screen-Shot-2015-03-27-at-09.59.44.png 576w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>And voila, the 60% and 40% vertical radius will do the trick.</p>
<p>&nbsp;</p>
<p>I can highly recommend this really interesting presentation from Lea Verou on border-radius. It&#8217;s 14 minutes and highly worth the time.</p>
<p>&nbsp;</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/JSaMl2OKjfQ?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>&nbsp;</p>
<p>Also, CSS Tricks has a collection of pre-cooked css shapes for inspiration: <a href="https://css-tricks.com/examples/ShapesOfCSS">CSS-Tricks.com:ShapesOfCSS</a></p>
]]></content:encoded>
							<wfw:commentRss>http://justaddwater.dk/2015/03/29/easter-egg-css-circles/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
							</item>
		<item>
		<title>Rewrite author/email in git history</title>
		<link>http://justaddwater.dk/2015/01/21/rewrite-authoremail-in-git-history/</link>
				<pubDate>Wed, 21 Jan 2015 14:25:38 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1733</guid>
				<description><![CDATA[After my harddisk crashed and I reinstalled the machine recently, I misconfigured my Git to set EMAIL as email address. This made Git history look horrible, with incorrect email, image. By accident I even wrote an incorrect name at one point. &#160; Note the missing image. &#160; Now it turns out my git repository was full [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>After my harddisk crashed and I reinstalled the machine recently, I misconfigured my Git to set EMAIL as email address.</p>
<p>This made Git history look horrible, with incorrect email, image. By accident I even wrote an incorrect name at one point.</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.16.09.png"><img class="aligncenter size-medium wp-image-1734" src="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.16.09-300x265.png" alt="git history github" width="300" height="265" srcset="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.16.09-300x265.png 300w, http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.16.09.png 898w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p>Note the missing image.</p>
<p>&nbsp;</p>
<p>Now it turns out my git repository was full of EMAIL instead of my correct email address.</p>
<pre>$git log --pretty=fuller -1 9461d8b
commit 9461d8b
Author:     Jesper Rønn-Jensen &lt;EMAIL&gt;
AuthorDate: Tue Jan 13 09:56:13 2015 +0100
Commit:     Jesper Rønn-Jensen &lt;EMAIL&gt;
CommitDate: Tue Jan 13 09:56:13 2015 +0100
    adding install of hipchat and sourcetree</pre>
<p>&nbsp;</p>
<p>I had to rewrite the history in order to fix the email addresses. Turns out `git filter-branch` could help:</p>
<p>&nbsp;</p>
<p>NEW_MAIL=&#8221;jesp&#8230;.@gmail.com&#8221;<br />
git filter-branch &#8211;env-filter &#8216;<br />
&gt; if [[ &#8220;$GIT_AUTHOR_EMAIL&#8221; = &#8220;EMAIL&#8221; || &#8220;$GIT_AUTHOR_EMAIL&#8221; = &#8220;$NEW_MAIL&#8221; ]]<br />
&gt; then<br />
&gt; if [[ &#8220;$GIT_AUTHOR_NAME&#8221; = &#8220;Ben Alman&#8221; ]]<br />
&gt; then<br />
&gt; GIT_AUTHOR_NAME=&#8221;Jesper Rønn-Jensen&#8221;<br />
&gt; GIT_COMMITTER_NAME=&#8221;Jesper Rønn-Jensen&#8221;<br />
&gt; export GIT_AUTHOR_NAME<br />
&gt; export GIT_COMMITTER_NAME<br />
&gt; fi<br />
&gt;<br />
&gt; GIT_AUTHOR_EMAIL=&#8221;$NEW_MAIL&#8221;<br />
&gt; GIT_COMMITTER_EMAIL=&#8221;$NEW_MAIL&#8221;<br />
&gt; export GIT_AUTHOR_EMAIL<br />
&gt; export GIT_COMMITTER_EMAIL<br />
&gt; fi<br />
&gt; &#8216; &#8212; &#8211;all</p>
<p>10 seconds later, I could push the changed repository up back on the server. The result was much better:</p>
<p><a href="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.24.24.png"><img class="aligncenter size-medium wp-image-1735" src="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.24.24-203x300.png" alt="github log images fixed" width="203" height="300" srcset="http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.24.24-203x300.png 203w, http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.24.24-691x1024.png 691w, http://justaddwater.dk/wp-content/uploads/2015/01/Screen-Shot-2015-01-21-at-15.24.24.png 852w" sizes="(max-width: 203px) 100vw, 203px" /></a></p>
<p>&nbsp;</p>
<p>Nice result :) All of this trouble was because I wanted to script the setup of a new machine. I used <a title="Github.com: jesperronn/cowboy-dotfiles" href="https://github.com/jesperronn/cowboy-dotfiles/commits/master">my clone of Ben Alman&#8217;s dotfiles</a>, and this way his name slipped in before I figured out how to configure the .gitconfig file.</p>
<p>I really like that Git enables you to do almost anything. Especially that you can make mistakes and fix them later :)</p>
]]></content:encoded>
										</item>
		<item>
		<title>iPhoto 11 performance tuning tips, revised</title>
		<link>http://justaddwater.dk/2014/03/09/iphoto-11-performance-tuning-tips-revised/</link>
				<pubDate>Sun, 09 Mar 2014 19:41:07 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[justaddwater.dk]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1709</guid>
				<description><![CDATA[My iPhoto library with 6000+ family photos was running slow on my macbook. So I looked for performance tuning tips on the net. Here are the adjusted tip, which works for me. &#160; This Apple support  thread mentioned 3 tips: Upgrade RAM Turn off visual bling in overview pages Vacuum iPhoto database file  Could not do [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>My iPhoto library with 6000+ family photos was running slow on my macbook. So I looked for performance tuning tips on the net.</p>
<p>Here are the adjusted tip, which works for me.</p>
<p>&nbsp;</p>
<p>This <a href="https://discussions.apple.com/thread/3012995?start=60&amp;tstart=0">Apple support  thread</a> mentioned 3 tips:</p>
<ol>
<li>Upgrade RAM</li>
<li>Turn off visual bling in overview pages</li>
<li>Vacuum iPhoto database file<span style="line-height: 1.5em;"> </span></li>
</ol>
<p>Could not do anything with tip 1 today (and I presume I cannot update the RAM on this 2012 macbook air)</p>
<p>Tip2 works: Go into settings &gt; &#8220;appearance&#8221; and turn off &#8220;Outline&#8221; and &#8220;Drop shadow&#8221; in the overviews.</p>
<p>Tip3 needs adjustment. Originally *.db files were only in top folder &#8216; ~/Pictures/iPhoto\ Library/&#8217;</p>
<p>&nbsp;</p>
<p>Adjusted command to vacuum iPhoto database files:</p>
<p>&nbsp;</p>
<blockquote>
<pre>cd ~/Pictures/iPhoto\ Library/ &amp;&amp;  for dbase in `find . -name '*.db'`; do sqlite3 $dbase "vacuum;"; done</pre>
</blockquote>
]]></content:encoded>
										</item>
		<item>
		<title>Generate CSS sprite for all world&#8217;s flags</title>
		<link>http://justaddwater.dk/2013/06/19/generate-css-sprite-for-all-worlds-flags/</link>
				<comments>http://justaddwater.dk/2013/06/19/generate-css-sprite-for-all-worlds-flags/#comments</comments>
				<pubDate>Wed, 19 Jun 2013 12:46:24 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[justaddwater.dk]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1594</guid>
				<description><![CDATA[Recently i worked on a project, which had to use flag icons for all flags in the world. The implementation looked like this: css file: . &#160; &#160; In order to reduce the number of HTTP requests, I wanted to change it to using CSS sprites instead. &#160; CSS file now has changed to lines [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>Recently i worked on a project, which had to use flag icons for all flags in the world. The implementation looked like this:</p>
<p>css file:</p>
<p>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>In order to reduce the number of HTTP requests, I wanted to change it to using CSS sprites instead.</p>
<p>&nbsp;</p>
<p>CSS file now has changed to lines like this:</p>
<p>.er_16{ background-position: -20px 0; }<br />
.es_16{ background-position: -20px -20px; }<br />
.et_16{ background-position: -20px -40px; }<br />
.fi_16{ background-position: -20px -60px; }</p>
<p>&nbsp;</p>
<p>&gt; Generation of sprite: http://spritegen.website-performance.org/</p>
<p>&gt; * Upload zip file with flags (in my case all the 16&#215;16 px flags)<br />
&gt; * ignore duplicate images<br />
&gt; * build direction vertical<br />
&gt; * offset 4px (since the images are 16&#215;14, this will make a 20-20 grid)<br />
&gt; * background/transparency colour: #ffffff<br />
&gt; * output format: PNG<br />
<span style="font-size: 13px; line-height: 19px;">&gt; * Compress Image with OptiPNG: YES<br />
</span><span style="font-size: 13px; line-height: 19px;">&gt; * Number of colours: True colour<br />
</span><span style="font-size: 13px; line-height: 19px;">&gt; * css suffix: _16 (to indicate 16px icons)</span></p>
<p>&nbsp;</p>
<p>Oh, before creatign the zip file, I removed all countries not matching a two-letter code.</p>
<p>cd 16/</p>
<p>find . -type f -name &#8216;???????*&#8217; |xargs -I{} rm {}</p>
<p>This would remove countries named &#8220;_African Union.png&#8221;, &#8220;_United Nations.png&#8221;, &#8220;Olimpic Movement.png&#8221;  and similar.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>For the following sizes of flags, I used these offset values:</p>
<p>16px, offset 4px will make a 20px grid</p>
<p>24px, offset 6px will make a 30px grid</p>
<p>32px, offset 8px will make a 40pxgrid</p>
<p>48px, offset 2px will make a 50px grid</p>
<p>64px, offset 6px will make a 70px grid</p>
<p>128px, offset 2px will make a 130px grid</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>http://justaddwater.dk/2013/06/19/generate-css-sprite-for-all-worlds-flags/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
							</item>
		<item>
		<title>Git checkout old revisions by date</title>
		<link>http://justaddwater.dk/2012/11/09/git-checkout-old-revisions-by-date/</link>
				<pubDate>Fri, 09 Nov 2012 22:24:06 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1658</guid>
				<description><![CDATA[I wanted to do some code stats for a repository. This line checks out old revisions by date and shows code stats: git checkout `git rev-list -n 1 --before="2012-03-01" master` Then, I ran cloc to count lines of code: cloc . Its really easy to register the point in time as a git branch so [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>I wanted to do some code stats for a repository. This line checks out old revisions by date and shows code stats:</p>
<pre><code>git checkout `git rev-list -n 1 --before="2012-03-01" master`</code></pre>
<p>Then, I ran cloc to count lines of code:</p>
<pre><code>cloc .</code></pre>
<p>Its really easy to register the point in time as a git branch so that you can get back and count lines of code later:</p>
<pre><code>git co -b 2012-03</code></pre>
<p>You can always verify latest revision like so:</p>
<pre><code>Git log -1</code></pre>
<p>The combination of git and cloc makes it really simple to keep history of codebase changes.</p>
<pre><code>
</code></pre>
]]></content:encoded>
										</item>
		<item>
		<title>PhantomJS 1.7 build for Linux 64 bit</title>
		<link>http://justaddwater.dk/2012/09/28/phantomjs-1-7-build-for-linux-64-bit/</link>
				<comments>http://justaddwater.dk/2012/09/28/phantomjs-1-7-build-for-linux-64-bit/#comments</comments>
				<pubDate>Fri, 28 Sep 2012 08:54:39 +0000</pubDate>
		<dc:creator><![CDATA[Jesper Rønn-Jensen]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Continous integration]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[phantomjs]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://justaddwater.dk/?p=1663</guid>
				<description><![CDATA[At a project I work on, we needed PhantomJS to run from a Redhat Fedora 64 bit machine. Since phantomJs is just released this week, I needed to build it myself. &#160; I post this link to the binary in case it can benefit others. &#160; PhantomJs 1.7.0 built on Linux Redhat Fedora 64 bit [&#8230;]]]></description>
								<content:encoded><![CDATA[<p>At a project I work on, we needed PhantomJS to run from a Redhat Fedora 64 bit machine.</p>
<p>Since phantomJs is just released this week, I needed to build it myself.</p>
<p>&nbsp;</p>
<p>I post this link to the binary in case it can benefit others.</p>
<p>&nbsp;</p>
<p><a href="http://dl.dropbox.com/u/54307969/phantomjs-1.7.0-linux-x86_64.tar.gz">PhantomJs 1.7.0 built on Linux Redhat Fedora 64 bit</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>PhantomJS is a fantastic tool for automating tests, since it is a headless browser which we wrapped in our automation framework to run javascript based tests very fast and easily.</p>
<p>&nbsp;</p>
<p>I followed the <a title="Phantomjs 1.7.0 official build instructions" href="http://phantomjs.org/build.html">build instructions</a> (the instructions described for Amazon EC2 also worked on the fedora I am running).</p>
<blockquote>
<pre>sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.7
./build.sh --jobs 1</pre>
<pre></pre>
<pre>#(added step below by me)
sudo yum install upx</pre>
<pre>After finishing the build, run deploy/package.sh which creates PhantomJS binary tarball that can be moved around and/or extracted to a different location. This is the correct way to install the built binary into an arbitrary directory, i.e. do not simply copy the executable as it won't work.</pre>
</blockquote>
<p>The link I posted is the actual outcome of ./deploy/package.sh</p>
<p>&nbsp;</p>
<p>For other operating systems, you could probably just get the binary at the official <a href="http://phantomjs.org/download.html">PhantomJs download page</a>.</p>
]]></content:encoded>
							<wfw:commentRss>http://justaddwater.dk/2012/09/28/phantomjs-1-7-build-for-linux-64-bit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
							</item>
	</channel>
</rss>
