<?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>ReadyState4 &#187; bash</title>
	<atom:link href="http://readystate4.com/category/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://readystate4.com</link>
	<description>JavaScript, Web Development, Ruby, and Technology.</description>
	<lastBuildDate>Fri, 18 May 2012 06:14:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Great little bash snippet to summarize your daily git commits.</title>
		<link>http://readystate4.com/2012/01/09/great-little-bash-snippet-to-summarize-your-daily-git-commits/</link>
		<comments>http://readystate4.com/2012/01/09/great-little-bash-snippet-to-summarize-your-daily-git-commits/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 23:15:02 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://readystate4.com/?p=434</guid>
		<description><![CDATA[For general invoicing and hour tracking, I like to post the details of my git commits. Though, I had my own little version of this script, this one posted at stackoverflow was a lot better looking. Posted here for posterity: function gdaily &#123; NEXT=$&#40;date +%F&#41; echo &#34;CHANGELOG&#34; echo ---------------------- git log --no-merges --format=&#34;%cd&#34; --date=short &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>For general invoicing and hour tracking, I like to post the details of my git commits. Though, I had my own little version of this script, this one posted at <a href="http://stackoverflow.com/questions/2976665/git-changelog-day-by-day/2979587#2979587">stackoverflow</a> was a lot better looking. Posted here for posterity:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> gdaily <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">NEXT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>F<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;CHANGELOG&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">----------------------</span>
    git log <span style="color: #660033;">--no-merges</span> <span style="color: #660033;">--format</span>=<span style="color: #ff0000;">&quot;%cd&quot;</span> <span style="color: #660033;">--date</span>=short <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-u</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> DATE ; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$DATE</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #007800;">GIT_PAGER</span>=<span style="color: #c20cb9; font-weight: bold;">cat</span> git log <span style="color: #660033;">--no-merges</span> <span style="color: #660033;">--format</span>=<span style="color: #ff0000;">&quot; * %s&quot;</span> <span style="color: #660033;">--since</span>=<span style="color: #007800;">$DATE</span> <span style="color: #660033;">--until</span>=<span style="color: #007800;">$NEXT</span>
        <span style="color: #007800;">NEXT</span>=<span style="color: #007800;">$DATE</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p></p>
<p>Which looks like:</p>
<pre>[2012-01-07]
 * Refactor list portfolio page css and js.
 * namespace.data include to load fake api data until it is ready. Portfolio list working again.
 * CurrentUser model defaults and code cleanup.

[2012-01-06]
 * Upgrade portfolio call from GET and POST. To be discussed in tomorrow's standup.</pre>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2012/01/09/great-little-bash-snippet-to-summarize-your-daily-git-commits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert a file to utf8-encoding via command-line</title>
		<link>http://readystate4.com/2011/06/20/convert-a-file-to-utf8-encoding-via-command-line/</link>
		<comments>http://readystate4.com/2011/06/20/convert-a-file-to-utf8-encoding-via-command-line/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 08:56:50 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[mongodb]]></category>

		<guid isPermaLink="false">http://readystate4.com/?p=333</guid>
		<description><![CDATA[I had an issue importing a large CSV to mongodb using mongoimport. I was getting the error: exception:Invalid UTF8 character detected Use iconv, a program that seems to be on both mac and most unix systems: iconv -f ISO-8859-1 -t utf-8 accounts.csv > accounts-utf8.csv Then continue on your merry way: mongoimport --type csv --headerline --drop [...]]]></description>
			<content:encoded><![CDATA[<p>I had an issue importing a large CSV to mongodb using mongoimport. I was getting the error:</p>
<pre>exception:Invalid UTF8 character detected</pre>
<p>Use iconv, a program that seems to be on both mac and most unix systems:</p>
<pre>iconv -f ISO-8859-1 -t utf-8 accounts.csv > accounts-utf8.csv</pre>
<p>Then continue on your merry way:</p>
<pre style="overflow: auto;">mongoimport --type csv --headerline --drop --port 7777  -d dbname -c collectionname --file accounts-utf8.csv</pre>
]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2011/06/20/convert-a-file-to-utf8-encoding-via-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using make to concatenate JS files</title>
		<link>http://readystate4.com/2010/12/21/using-make-to-concatenate-js-files/</link>
		<comments>http://readystate4.com/2010/12/21/using-make-to-concatenate-js-files/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 18:28:41 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mak]]></category>

		<guid isPermaLink="false">http://readystate4.com/?p=114</guid>
		<description><![CDATA[In a previous project I used a bash script in conjunction with a git hook to concatenate all my js files and increment build numbers in html file references (cache-kill) after every commit. This was convenient at first, but quickly got annoying as I wasn&#8217;t always committing js file changes. I eventually opted to just [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous project I used a bash script in conjunction with a git hook to concatenate all my js files and increment build numbers in html file references (cache-kill) after every commit. This was convenient at first, but quickly got annoying as I wasn&#8217;t always committing js file changes. I eventually opted to just call the script manually before any deployment to qa or production, thinking I would automate it again one day to only be called when JS files were changed (git hooks probably provide this info).</p>
<p>Today I read up on make. I&#8217;ve always used make in the past to build versions of a program for my system but never how it actually worked. When ran, it essentially reads in a list of dependencies, and if the source files have modification times newer than the &#8220;built&#8221; file, it runs your script to rebuild them. Concatenating javascript files seems like the perfect opportunity for this. I&#8217;ll rewrite my bash script to use make, set it as a git hook, and should be able to forget it. Will let you know how it goes. </p>
]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2010/12/21/using-make-to-concatenate-js-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash argument unpacking</title>
		<link>http://readystate4.com/2009/09/10/bash-argument-unpacking/</link>
		<comments>http://readystate4.com/2009/09/10/bash-argument-unpacking/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 19:31:14 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://readystate4.com/2009/09/10/bash-argument-unpacking/</guid>
		<description><![CDATA[I&#8217;m not a bash expert but my .bash_profile is packed with shortcut goodness to do all kinds of things on the quick. Most recently, I wondered how to fix up some of my function shortcuts to take any number of arguments (similar to this argument unpacking entry on how to do it in JavaScript and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not a bash expert but my <code>.bash_profile</code> is packed with shortcut goodness to do all kinds of things on the quick. Most recently, I wondered how to fix up some of my function shortcuts to take any number of arguments (similar to this <a href="http://readystate4.com/2008/08/17/javascript-argument-unpacking-converting-an-array-into-a-list-of-arguments/">argument unpacking entry</a> on how to do it in JavaScript and Ruby).</p>
<p>With a little Googling and IM&#8217;ing around to friends (thanks <a href="http://deserialized.com/">Bryan</a>), my limited argument functions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> sc <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #c20cb9; font-weight: bold;">svn</span> commit $<span style="color: #000000;">1</span> $<span style="color: #000000;">2</span> $<span style="color: #000000;">3</span> $<span style="color: #000000;">4</span> $<span style="color: #000000;">5</span> $<span style="color: #000000;">6</span>               
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>now take an unlimited number of arguments:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> sc <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #c20cb9; font-weight: bold;">svn</span> commit $<span style="color: #000000; font-weight: bold;">@</span>               
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2009/09/10/bash-argument-unpacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

