<?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">

	<channel>
		<title>//TNG - The Nitty Gritty Feed</title>
		<link>http://thenittygritty.co/home</link>
		<generator>Kirby</generator>
		<lastBuildDate>Wed, 19 Jun 2013 13:59:15 +0000</lastBuildDate>
		<atom:link href="http://thenittygritty.co/home/feed" rel="self" type="application/rss+xml" />

				<description>The low down on web technology feed</description>
		
				<item>
			<title>Type Is Back Big Time</title>
			<link>http://thenittygritty.co/type-is-back-bigtime</link>
			<guid>http://thenittygritty.co/type-is-back-bigtime</guid>
			<pubDate>Wed, 12 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[Great video interview of the guys at edenspiekermann_ about the role of type in branding.]]></description>
							
			<content:encoded><![CDATA[<p>Great video interview of the guys at <a href="http://www.edenspiekermann.com/">edenspiekermann_</a> about the role of type in branding.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Page Weight Matters</title>
			<link>http://thenittygritty.co/page-weight-matters</link>
			<guid>http://thenittygritty.co/page-weight-matters</guid>
			<pubDate>Wed, 12 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[After a week of data collection, the numbers came back… and they were baffling. Great story about the importance of a low page weight.]]></description>
							
			<content:encoded><![CDATA[<blockquote>
  <p>After a week of data collection, the numbers came back… and they were baffling.</p>
</blockquote>

<p>Great story about the importance of a low page weight.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Release: grunt-textfile</title>
			<link>http://thenittygritty.co/release-grunt-textfile</link>
			<guid>http://thenittygritty.co/release-grunt-textfile</guid>
			<pubDate>Thu, 06 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[If you are using a text file based blogging software like Jekyll, Kirby or Middleman you probably were annoyed at some point to manually have to create your text file with correctly formatted file and/or folder name including post-specific meta data. grunt-textfile I surely am, especially in the…]]></description>
							
			<content:encoded><![CDATA[<p><strong>If you are using a text file based blogging software like <a href="http://jekyllrb.com">Jekyll</a>, <a href="http://getkirby.com">Kirby</a> or <a href="http://middlemanapp.com">Middleman</a> you probably were annoyed at some point to manually have to create your text file with correctly formatted file and/or folder name including post-specific meta data.</strong></p>

<p><figure class="image-full"><img src="http://thenittygritty.co/content/home/32-release-grunt-textfile/grunt-textfile.jpg" alt="grunt-textfile" /><figcaption>grunt-textfile</ficaption></figure></p>

<p>I surely am, especially in the case of link blogging since you tend to post multiple links in a short amount of time and these posts are really short you don't want to spend a lot of time on them.</p>

<p>We use Kirby for TNG and in order to create a new link post we have to create a new folder which has a specific naming pattern and a text file that also has a specific name and contains some meta data. I love Kirby and managing my content in text files but, boy, that is tedious!</p>

<h2>Enter grunt-textfile!</h2>

<p>I am happy to announce the release of <a href="http://github.com/kahlil/grunt-textfile">grunt-textfile</a> today. If you use <a href="http://gruntjs.com">Grunt</a> in your project anyway it is very easy to add and configure for your specific text file based content management needs.</p>

<p>After you configured the plugin in the Gruntfile all you have to do is to call the task on the command line with the desired options i.e.:</p>

<p><span class="language-bash"></span></p>

<pre><code>grunt textfile --title="grunt-textfile Is Where It's At!"
</code></pre>

<p>Head over to <a href="http://github.com/kahlil/grunt-textfile">the repo</a> and check it out.</p>

<p>Let me know about any bugs or feedback in <a href="http://github.com/kahlil/grunt-textfile">the issues</a>. Pull requests are always welcome if you want to add some functionality!</p>

<h2>Writing grunt-textfile</h2>

<p>Man, I &hearts; Grunt.js to death, yo.</p>

<p>It is amazing how powerful and flexible it is. The documentation is really great now and the API gives you a lot to work with. I specifically made use of the <code>grunt.template</code> and <code>grunt.option</code> methods.</p>

<h3>Using the Grunt.js API</h3>

<p><code>grunt.template</code> takes care of processing the text file templates and since the grunt object is available within the template you can use the grunt API right there. This means it allows you to insert things like <code>grunt.template.today('yyyy-mm-dd')</code> or <code>grunt.option('link')</code>. No extra parser to write.</p>

<p>Once you set up the template like that you can do the following:</p>

<p><span class="language-javascript"></span></p>

<pre><code>// Check if the file exists.
if (!grunt.file.exists(filePath)) {
  // Warn the user if the file doesn't exist.
  grunt.log.warn('Template file "' + filePath + '" not found.');
  return false;
} else {
  // Read the file.
  template = grunt.file.read(filePath);
}

// Process the template and normalize the line feeds.
result = grunt.util.normalizelf(grunt.template.process(template));
</code></pre>

<p>After that I just concatenate the path for the resulting file and write it to that location with <code>grunt.file.write(fullPath, result)</code>.</p>

<h3>Using String.js</h3>

<p>To replace the keywords in the file/folder name patterns, I am using <a href="http://stringjs.com">String.js</a>. It is a very capable string manipulation library that works like jQuery:</p>

<p><span class="language-javascript"></span></p>

<pre><code>// Cache the String.js object.
sFilename = S(options.urlFormat);
// Check for the keywords with .contains().
if(sFilename.contains('PREFIX')) {
  // For Kirby blogs: count the directories in target dir and iterate the prefix.
  dirs      = grunt.file.expand({filter: 'isDirectory'}, options.dest + '/*');
  // Replace the keyword with the correct prefix.
  sFilename = sFilename.replaceAll('PREFIX', dirs.length + 1);
}
if(sFilename.contains('SLUG')) {
  // Replace keyword with the slug. Use slugify() method.
  sFilename = sFilename.replaceAll('SLUG', S(grunt.option('title')).slugify());
}
if(sFilename.contains('DATE')) {
  // Replace keyword with date generated with grunt.template
  sFilename = sFilename.replaceAll('DATE', grunt.template.today(options.urlDateFormat));
}

// Return the actual string by returning the .s property of the String.js object
return sFilename.s
</code></pre>

<h3>Testing</h3>

<p>In order to test the plugin I am <a href="https://github.com/kahlil/grunt-textfile/blob/master/test/textfile_test.js#L57-L69">generating a test file and compare it with an expected file</a>. I also move helper functions into <code>lib/textfile.js</code> and expose them via <code>exports</code>. These functions can then be <a href="https://github.com/kahlil/grunt-textfile/blob/master/test/textfile_test.js#L31-L55">easily called and tested via nodeunit</a>.</p>

<h2>Conclusion</h2>

<p>If you manage your blog's content in text files I hope you give grunt-textfile a try. Let me know if you run in to any problems or miss any features.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Discussion On Mobile First Yeoman Generator</title>
			<link>http://thenittygritty.co/discussion-on-mobile-first-yeoman-generator</link>
			<guid>http://thenittygritty.co/discussion-on-mobile-first-yeoman-generator</guid>
			<pubDate>Sun, 09 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[@addyosmani: We want to create a mobile-first scaffolding solution for Yeoman that helps web app developers quickly kickstart projects with sane defaults. Chime in!]]></description>
							
			<content:encoded><![CDATA[<p><a href="http://twitter.com/addyosmani">@addyosmani</a>:</p>

<blockquote>
  <p>We want to create a mobile-first scaffolding solution for Yeoman that helps web app developers quickly kickstart projects with sane defaults.</p>
</blockquote>

<p>Chime in!</p>
]]></content:encoded>

		</item>
				<item>
			<title>Seriously.js</title>
			<link>http://thenittygritty.co/seriouslyjs</link>
			<guid>http://thenittygritty.co/seriouslyjs</guid>
			<pubDate>Sun, 09 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[Seriously.js is a real-time, node-based video compositor for the web. Inspired by professional software such as After Effects and Nuke, Seriously.js renders high-quality video effects, but allows them to be dynamic and interactive. Mozilla showing off some crazy stuff here.]]></description>
							
			<content:encoded><![CDATA[<blockquote>
  <p>Seriously.js is a real-time, node-based video compositor for the web. Inspired by professional software such as After Effects and Nuke, Seriously.js renders high-quality video effects, but allows them to be dynamic and interactive.</p>
</blockquote>

<p>Mozilla showing off some crazy stuff here.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Inside World Wide Maze</title>
			<link>http://thenittygritty.co/inside-world-wide-maze</link>
			<guid>http://thenittygritty.co/inside-world-wide-maze</guid>
			<pubDate>Sun, 09 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[The game features abundant use of HTML5 features. For example, the DeviceOrientation event retrieves tilt data from the smartphone, which is then sent to the PC via WebSocket, where players find their way through 3D spaces built by WebGL and Web Workers. Woah.]]></description>
							
			<content:encoded><![CDATA[<blockquote>
  <p>The game features abundant use of HTML5 features. For example, the DeviceOrientation event retrieves tilt data from the smartphone, which is then sent to the PC via WebSocket, where players find their way through 3D spaces built by WebGL and Web Workers.</p>
</blockquote>

<p>Woah.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Gruber's Vesper</title>
			<link>http://thenittygritty.co/grubers-vesper</link>
			<guid>http://thenittygritty.co/grubers-vesper</guid>
			<pubDate>Sat, 08 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[@gruber launched his first iPhone app. John directed it, Dave Wiskus designed it and Brent Simmons implemented it. You can hear them talk about all the behind the scenes in the Debug podcast. Vesper Vesper is a simple and elegant tool for collecting your thoughts. I’ve been using it all day,…]]></description>
							
			<content:encoded><![CDATA[<p><a href="http://twitter.com/gruber">@gruber</a> launched his first iPhone app. John directed it, Dave Wiskus designed it and Brent Simmons implemented it. You can hear them talk about all the behind the scenes in the <a href="http://www.imore.com/debug-15-simmons-wiskus-gruber-and-vesper">Debug podcast</a>.</p>

<p><figure class="image-full"><img src="http://thenittygritty.co/content/home/28-grubers-vesper/vesper.jpg" alt="Vesper" /><figcaption>Vesper</ficaption></figure></p>

<blockquote>
  <p>Vesper is a simple and elegant tool for collecting your thoughts. I’ve been using it all day, every day for months now. I think you’ll like it.</p>
</blockquote>

<p>I love the app. The design and the attention to detail is tremendous and the simplicity of the idea is striking. I think this is the first time I am using tags in a sane and useful way. Definitely listen to the <a href="http://www.imore.com/debug-15-simmons-wiskus-gruber-and-vesper">podcast episode</a>, the insights into the their thinking and the way they worked are great for anybody who wants to build something.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Logic in Media Queries</title>
			<link>http://thenittygritty.co/logic-in-media-queries</link>
			<guid>http://thenittygritty.co/logic-in-media-queries</guid>
			<pubDate>Wed, 05 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[@chriscoyier on Mobile First: Your small screen styles are in your regular screen CSS and then as the screen gets larger you override what you need to. So, min-width media queries in general. Chris Coyier wrote up a nice collection of logical operators in Media Queries including and, or, not and a…]]></description>
							
			<content:encoded><![CDATA[<p><a href="http://twitter.com/chriscoyier">@chriscoyier</a> on Mobile First:</p>

<blockquote>
  <p>Your small screen styles are in your regular screen CSS and then as the screen gets larger you override what you need to. So, min-width media queries in general.</p>
</blockquote>

<p>Chris Coyier wrote up a nice collection of logical operators in Media Queries including <code>and</code>, <code>or</code>, <code>not</code> and a lot of other useful tips.</p>
]]></content:encoded>

		</item>
				<item>
			<title>Kirby 2 Reference Platform</title>
			<link>http://thenittygritty.co/kirby-2-reference-platform</link>
			<guid>http://thenittygritty.co/kirby-2-reference-platform</guid>
			<pubDate>Wed, 05 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[@bastianallgeier: I wrote a library, which extracts all kinds of documentation from the actual source code of Kirby 2 and builds the content structure and all the text files out of it. This makes it possible to write the documentation only once – in the source – and update the platform for…]]></description>
							
			<content:encoded><![CDATA[<p><a href="http://twitter.com/bastianallgeier">@bastianallgeier</a>:</p>

<blockquote>
  <p>I wrote a library, which extracts all kinds of documentation from the actual source code of Kirby 2 and builds the content structure and all the text files out of it. This makes it possible to write the documentation only once – in the source – and update the platform for every new release with just a click.</p>
</blockquote>

<p>Ah, very cool.</p>
]]></content:encoded>

		</item>
				<item>
			<title>DailyJS AngularJS Tutorial</title>
			<link>http://thenittygritty.co/dailyjs-angulartutorial</link>
			<guid>http://thenittygritty.co/dailyjs-angulartutorial</guid>
			<pubDate>Tue, 04 Jun 2013 00:00:00 +0000</pubDate>

												<description><![CDATA[@alexyoung: Most of what I’m going to talk about here has been packaged up into Yeoman, which has some Google employees behind it (Paul Irish, Addy Osmani) and includes technology from Twitter (Bower). The rest of this post will break down the emerging next generation Google/Twitter open source…]]></description>
							
			<content:encoded><![CDATA[<p><a href="http://twitter.com/alexyoung">@alexyoung</a>:</p>

<blockquote>
  <p>Most of what I’m going to talk about here has been packaged up into Yeoman, which has some Google employees behind it (Paul Irish, Addy Osmani) and includes technology from Twitter (Bower). The rest of this post will break down the emerging next generation Google/Twitter open source stack.</p>
</blockquote>

<p>Another great series by Alex Young.</p>
]]></content:encoded>

		</item>
		
	</channel>
</rss>
