<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[jedcn.com]]></title>
  <link href="http://jedcn.com/atom.xml" rel="self"/>
  <link href="http://jedcn.com/"/>
  <updated>2014-08-05T15:11:00-04:00</updated>
  <id>http://jedcn.com/</id>
  <author>
    <name><![CDATA[Jed Northridge]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[cless]]></title>
    <link href="http://jedcn.com/posts/cless/"/>
    <updated>2014-08-05T14:29:00-04:00</updated>
    <id>http://jedcn.com/posts/cless</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>Consider swapping out the standard &ldquo;less&rdquo; pager for one that has
syntax highlighting.</p>

<p>Here&rsquo;s one way to achieve this:</p>

<p><a href="https://github.com/jedcn/dot-org-files/blob/cd535d6c6ae3ddcf8f6bd9f10fe63de007a49a5f/org/zshrc.org#cl-cless">cless</a>, which builds on <a href="https://github.com/jedcn/dot-org-files/blob/cd535d6c6ae3ddcf8f6bd9f10fe63de007a49a5f/org/zshrc.org#c">c</a>.</p>

<p>Back in 2012, Paul Irish <a href="https://twitter.com/paul_irish/status/257310654631919616">tweeted a neat way</a> to make &ldquo;cat&rdquo;
colorized.</p>

<p>If you do this, and you like this, you can get a colorized less with
no more work than a two line shell function.</p>

<p>If you&rsquo;re looking for another way to get syntax highlighting with
less, there&rsquo;s something called lesspipe, but I haven&rsquo;t looked into it
yet.</p>

<p>So far I&rsquo;m happy with cless.</p>

<h2>Resources</h2>

<ul>
<li><a href="https://github.com/jedcn/dot-org-files/blob/cd535d6c6ae3ddcf8f6bd9f10fe63de007a49a5f/org/zshrc.org#c">A shell alias for colorized cat</a></li>
<li><a href="https://twitter.com/paul_irish/status/257310654631919616">Paul Irish&rsquo;s original &ldquo;c&rdquo; tweet</a></li>
<li><a href="https://github.com/jedcn/dot-org-files/blob/cd535d6c6ae3ddcf8f6bd9f10fe63de007a49a5f/org/zshrc.org#cl-cless">A shell function for colorized less</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Screen Zoom]]></title>
    <link href="http://jedcn.com/posts/screen-zoom/"/>
    <updated>2014-03-08T12:36:00-05:00</updated>
    <id>http://jedcn.com/posts/screen-zoom</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>Enabling the ability to magnify any part of your screen, at the level
of your window manager (or operating system), is a key piece of
functionality that you should figure out today.</p>

<h1>Background</h1>

<p>Zooming into any part of your screen is something you can use every
day:</p>

<ul>
<li>When you are working by yourself you can reduce eye fatigue.</li>
<li>When you are working with one other person, you can make it easier
for them to &ldquo;look over your shoulder.&rdquo;</li>
<li>When you are projecting your computer&rsquo;s display in a small
conference room with 3 or 4 other people or even a huge conference
room filled with hundreds of people, someone is going to call out
(or silently suffering while thinking), &ldquo;Can you please make this
larger?&rdquo;</li>
</ul>


<p>And when you want to zoom, you&rsquo;ll find yourself saying,</p>

<blockquote><p>Oh, just one second&#8211; let me try to make this bigger.</p></blockquote>


<p>And if you&rsquo;ve got this figured out&mdash; it just takes a moment&rsquo;s notice&mdash;
less than a second&mdash; and you can make any text huge.</p>

<p>But if you don&rsquo;t have it figured out, you&rsquo;ll start thinking, &ldquo;How do I
increase the text in &lt;whatever-application-I-am-in>?&rdquo; It might be easy
or it might not. You might have it fixed in a bit or you might have to
give up and risk people tuning out. Either way&mdash; you&rsquo;ll get off topic.</p>

<p>If you allow &ldquo;zoom&rdquo; to be done on an application-by-application basis,
you are guaranteed to have inconsistent results. Your trusty browser
might be just fine, but maybe your editor or a spreadsheet application
will not be.</p>

<p>Perhaps the person you&rsquo;re working with has left her glasses at her
desk. Perhaps you&rsquo;re giving a talk and you see people squinting in the
back row.</p>

<p>Whatever the case,
<a href="http://speaking.io/design/typography/">Zach Holman is right when he says</a>,</p>

<blockquote><p>I have yet to see a talk that made me think: &#8216;goddamn I can’t read<br/>this because the text is too big&#8217;</p><footer><strong>Zach Holman</strong> <cite><a href='http://speaking.io/design/typography'>speaking.io/design/typography/&hellip;</a></cite></footer></blockquote>


<h1>The Solution</h1>

<p>In most cases, 15 minutes of research can provide a solution.</p>

<p>I first used this feature on Ubuntu, but now I use MacOS. If you&rsquo;re
using MacOS&mdash; you can easily make it so that pressing CONTROL and then
using a two-finger gesture on the track pad magnifies content in the
neighborhood of the mouse.</p>

<p>Here are the <a href="http://bkbeachlabs.com/blog/screen-zoom-in-os-x-mountain-lion/">instructions from bkbeachlabs</a> that
I followed.</p>

<p>It takes 5 minutes to implement and you won&rsquo;t look back.</p>

<h1>Resources</h1>

<ul>
<li><a href="http://speaking.io/design/typography/">http://speaking.io&rsquo;s section on typography</a></li>
<li><a href="http://bkbeachlabs.com/blog/screen-zoom-in-os-x-mountain-lion/">Instructions for Screen Zoom</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[emacs-setup]]></title>
    <link href="http://jedcn.com/posts/emacs-setup/"/>
    <updated>2013-09-04T17:18:00-04:00</updated>
    <id>http://jedcn.com/posts/emacs-setup</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>I am happy to have finished
<a href="https://github.com/jedcn/emacs-setup/tree/v0.0.1">the first draft</a> of my emacs
configuration! It is rudimentary, but I am proud of it all the
same. The configuration, and a written description of what is included
are available in <a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.pdf">PDF</a> and <a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.html">HTML</a>
and <a href="https://github.com/jedcn/emacs-setup/blob/v0.0.1/emacs-setup.el">elisp</a>.</p>

<h1>Background</h1>

<p>I had been looking for an excuse to wander around emacs, and the
opportunity arose recently as part of moving my config to a new
laptop. Rather than wholesale copy my old config, I was inspired to
create a new one by this advice:</p>

<blockquote><p> As an Emacs user, you&rsquo;re going to have to get comfortable seeking
 out new pieces of elisp, bringing them in, configuring them, and
 eventually writing your own. The Starter Kit can help this process
 by giving hints as to where to start and what to look for, but
 constructing a solid configuration is ultimately a personal journey
 for which you must take the first steps.</p></blockquote>

<p><a href="https://github.com/technomancy/emacs-starter-kit">&ndash; technomancy, Emacs Starter Kit, v3</a></p>

<p>Looking to take my &ldquo;first steps,&rdquo; and with my interest sparked in
Knuth&rsquo;s <a href="http://en.wikipedia.org/wiki/Literate_programming">Literate Programming</a> by
<a href="http://sachachua.com/blog/2012/06/literate-programming-emacs-configuration-file/">Sacha Chua</a>, I set off to write a coherent
prose description of my elisp config. The end result is my
<a href="https://github.com/jedcn/emacs-setup">emacs-setup</a>, and the ability to generate
<a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.pdf">a description of my config</a> as well as
<a href="https://github.com/jedcn/emacs-setup/blob/v0.0.1/emacs-setup.el">just the pure elisp</a>.</p>

<h1>Goals</h1>

<p>I set out to make a configuration that was:</p>

<ul>
<li><strong>Beautiful</strong>: The literate programming facilities in emacs allowed
me to rely on the LaTeX typesetting system and this meant the end
goal could be <a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.pdf">a nice looking PDF</a>.</li>
<li><strong>Well Documented</strong>: I am not comfortable with elisp, and I don&rsquo;t
spend that much time hacking on my config. Thorough documentation
enables me to more quickly get back into context when I return in
the future.</li>
</ul>


<p>Combining these two, my emphasis was on strong documentation and
beautiful typesetting <strong>from the start</strong> and as a <strong>top priority</strong>. I
suspect <em>Beautiful</em> and <em>Well Documented</em> would be the natural result
of most Literate Programming attempts. However, additional goals were
to make the configuration:</p>

<ul>
<li><strong>Organized</strong>: The system I am using allows my configuration to be
broken down into discrete files. Each file has a distinct purpose.
This is similar to the themes that Zach Holman espouses with
<a href="http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/">his dotfiles</a>.</li>
<li><strong>Reproducible</strong>: I wanted a system where I could run an <code>rm -rf
~/.emacs.d</code> without flinching and reliably be back to where I was
before the <code>rm</code> just a few moments later. This is inspired by
<a href="http://docs.vagrantup.com/v2/getting-started/rebuild.html">working with vagrant</a> and every-so-often testing
your configuration management setup by doing a <code>vagrant destroy;
vagrant up</code>.</li>
<li><strong>Easily Tested</strong>: I wanted to work with a system that allowed me to
have distinct installations living on the same machine. This is
closely related to reproducibility: if I can easily work with a new
version of my configuration at <code>/tmp/emacs-test</code>, then I can be
confident in deleting <code>~/.emacs.d</code>.</li>
</ul>


<p><em>Reproducible</em> and <em>Easily Tested</em> are not difficult to achieve with
emacs. The hardest part was having the discipline, from an early
stage, to actively delete my <code>~/.emacs.d</code> several times a day. I
admit, the first time I just did a <code>mv ~/.emacs.d
~/.emacs.d-please-work</code>, but it was pleasant to get to a point where I
could delete and re-create with ease.</p>

<h1>In Closing</h1>

<p>This was the first literate program that I wrote, and I enjoyed doing
it. I think I have a system that I understand, that I can maintain,
and that I can extend. Having written this up, I&rsquo;m off to go watch
some <a href="http://emacsrocks.com/">emacsrocks.com</a> or read up on some
<a href="http://emacsredux.com/">emacsredux.com</a> or learn more about elisp via
<a href="http://www.emacsbites.com/">emacsbites.com</a>.</p>

<p>Before I close the chapter on this post, I would be remiss if I didn&rsquo;t
at least point out that <a href="http://orgmode.org/worg/org-contrib/babel/">Babel</a> and <a href="http://orgmode.org/">Org-mode</a>, the
parts of emacs that enable literate programming, are a real delight to
work with! If you are thinking of treading this path, be sure to check
out Schulte&rsquo;s
<a href="http://www.jstatsoft.org/v46/i03">A Multi-Language Computing Environment for Literate Programming and Reproducible Research</a>.</p>

<h2>Resources</h2>

<ul>
<li>A PDF document describing my emacs-setup:
<a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.pdf">emacs-setup.pdf</a>.</li>
<li>An HTML document describing my emacs-setup:
<a href="http://jedcn.com/files/posts/emacs-setup/emacs-setup.html">emacs-setup.html</a>.</li>
<li>The elisp that is my emacs-setup: <a href="https://github.com/jedcn/emacs-setup/blob/v0.0.1/emacs-setup.el">emacs-setup.el</a>.</li>
<li><a href="https://github.com/jedcn/emacs-setup/tree/v0.0.1">The code from emacs-setup</a> (v0.0.1).</li>
<li><a href="http://sachachua.com/blog/2012/06/literate-programming-emacs-configuration-file/">Sacha Chua&rsquo;s Literate Emacs Config</a></li>
<li><a href="https://github.com/technomancy/emacs-starter-kit">Emacs Starter Kit</a>.</li>
<li>A good place to get excited about emacs:
<a href="http://emacsrocks.com/">emacsrocks.com</a>.</li>
<li>A good place to get excited about elisp:
<a href="http://www.emacsbites.com/">emacsbites.com</a>.</li>
<li>A neat site with emacs goodness: <a href="http://emacsredux.com/">emacsredux.com</a>.</li>
<li>Eric Shulte&rsquo;s <a href="http://www.jstatsoft.org/v46/i03">paper</a> on doing Literate
Programming in Emacs.</li>
<li><a href="http://orgmode.org/">Org-mode</a></li>
<li><a href="http://orgmode.org/worg/org-contrib/babel/">Babel</a>: active code in Org-mode</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[reveal-ck]]></title>
    <link href="http://jedcn.com/posts/reveal-ck/"/>
    <updated>2013-07-12T07:19:00-04:00</updated>
    <id>http://jedcn.com/posts/reveal-ck</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>If you&rsquo;re a web developer and have been asked to give a presentation
and need accompanying slides, then check out <a href="http://lab.hakim.se/reveal-js/">reveal.js</a>.</p>

<p>If you go this route, you will probably start by cloning the reveal.js
repository, finding the index.html file, and then you&rsquo;ll begin
replacing the default content with your own.</p>

<p>If you&rsquo;d like to have some help with fitting your content into
reveal.js, then you should take a look at
<a href="https://github.com/jedcn/reveal-ck">reveal-ck</a>. reveal-ck is short for &ldquo;reveal.js
construction kit.&rdquo;</p>

<p><a href="https://github.com/jedcn/reveal-ck">It</a> requires basic comfort with ruby and
<a href="http://haml.info/">haml</a>, and allows you to focus on putting your slide content
into a single file which will become an input to a command line tool.</p>

<p>The <a href="https://github.com/jedcn/reveal-ck">reveal-ck</a> gem comes with a command line
tool of the same name (<code>reveal-ck</code>) that transforms your content into
a <a href="http://lab.hakim.se/reveal-js/">reveal.js</a> slide deck.</p>

<h1>A Quick Example</h1>

<p>Open up a terminal, and make sure you have Ruby 1.9.3+ with <code>ruby -v</code>.</p>

<p>Then, install reveal-ck with <code>gem install reveal-ck --no-rdoc --no-ri</code>.</p>

<p>Verify that reveal-ck is present with <code>reveal-ck --help</code>.</p>

<p>As a first step toward creating a set of slides, put the following
into a file named <code>slides.haml</code>:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'><span class="nt">%section</span>
</span><span class='line'>  3
</span><span class='line'>
</span><span class='line'><span class="nt">%section</span>
</span><span class='line'>  2
</span><span class='line'>
</span><span class='line'><span class="nt">%section</span>
</span><span class='line'>  1
</span><span class='line'>
</span><span class='line'><span class="nt">%section</span>
</span><span class='line'>  Contact!
</span></code></pre></td></tr></table></div></figure>


<p>Each <code>%section</code> above represents a new slide. There are four slides:
3, 2, 1, and Contact!</p>

<p>Once you&rsquo;ve got that saved in a file name <code>slides.haml</code>, run
<code>reveal-ck generate</code>, and you&rsquo;re done!</p>

<p>Your slides will be available at <code>slides/index.html</code>. If you are using
MacOS, you can preview them with <code>open slides/index.html</code>.</p>

<p>I&rsquo;ve generated these slides and put
<a href="../../files/posts/reveal-ck/simple/slides/index.html">the result online</a>.</p>

<h1>The Basics</h1>

<p>The example above is as simple as it gets. Here are a few more
thoughts on getting the most out of reveal-ck and reveal.js.</p>

<h2>haml</h2>

<p>The content that goes in <code>slides.haml</code> is <a href="http://haml.info/">haml</a>.</p>

<p>The reason reveal-ck does not author slides only in Markdown is
because most of the <em>really neat and more advanced</em> stuff that you can
do with reveal.js requires the ability to get at the underlying HTML
classes and attributes.</p>

<p>Haml has a slight learning curve, but it is pretty slick once you get
going. If you&rsquo;re new to haml, check out
<a href="http://haml.info/docs/yardoc/file.REFERENCE.html">the haml reference</a> or
<a href="http://haml.info/tutorial.html">the haml tutorial</a>.</p>

<h2>slim</h2>

<p>You can also use slim with reveal-ck. The general idea is the same,
but create a file named <code>slides.slim</code> instead.</p>

<p>If you&rsquo;re new to slim, check out <a href="http://rdoc.info/gems/slim/frames">the slim reference</a>
or <a href="http://slim-lang.com/">the main slim site</a>.</p>

<h2>markdown</h2>

<p>If you don&rsquo;t need the more advanced features of reveal.js, or if you
just like markdown, reveal-ck bundles redcarpet for markdown
processing. This means that you can embed markdown in both slim and
haml. For example, in haml:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'><span class="nt">%section</span>
</span><span class='line'>  <span class="nd">:markdown</span>
</span><span class='line'>    <span class="nd"># Hello</span>
</span><span class='line'>    <span class="nd">## ..there!</span>
</span></code></pre></td></tr></table></div></figure>


<h2>ruby</h2>

<p>You can also author slides in Ruby. The benefit of doing this is that
you can build out a presentation programmatically. Here are
<a href="https://github.com/jedcn/reveal-ck/blob/master/doc/slides_with_ruby.md">some instructions</a> if you&rsquo;d like to learn more.</p>

<h2>Alternate Slides File</h2>

<p>By default, reveal-ck expects to find your slides in a file named
<code>slides.haml</code>, <code>slides.slim</code>, or <code>slides.rb</code>. However, you can pick a
different name that ends with <code>haml</code>, <code>slim</code> or <code>rb</code> and invoke
reveal-ck like so:</p>

<p><code>reveal-ck generate --file water-slides.haml</code></p>

<h2>reveal.js effects and styling</h2>

<p>To get the most of out reveal.js you need to understand the classes,
markup, and data attributes that it expects. For example, if you want
something to be initially hidden and then fade in when you advance
slides, you need to add the <code>fragment</code> class. Here&rsquo;s an example where
everything with <code>fragment</code> is hidden initially and then appears in
stages as you advance:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'><span class="nt">%section</span>
</span><span class='line'>  <span class="nt">%p</span>
</span><span class='line'>    RSpec is
</span><span class='line'>    <span class="nt">%a</span><span class="p">{</span> <span class="ss">href</span><span class="p">:</span> <span class="s2">&quot;https://github.com/rspec/rspec&quot;</span> <span class="p">}</span> Behaviour Driven Development for Ruby
</span><span class='line'>    <span class="nt">%span</span><span class="nc">.fragment</span> And this is great.
</span><span class='line'>    <span class="nt">%span</span><span class="nc">.fragment</span> And RSpec is great.
</span><span class='line'>    <span class="nt">%span</span><span class="nc">.fragment</span> But..
</span></code></pre></td></tr></table></div></figure>


<p>And here is an example where vertical slides are used:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'><span class="nt">%section</span>
</span><span class='line'>  <span class="nt">%section</span>
</span><span class='line'>    Vertical Slide 1
</span><span class='line'>  <span class="nt">%section</span>
</span><span class='line'>    Vertical Slide 2
</span></code></pre></td></tr></table></div></figure>


<p>The way to make progress here is to look at reveal.js proper and read
through its documentation (and examine the markup for the default
slides). reveal-ck has an embedded version of reveal.js. If things
aren&rsquo;t working as expected, drop me a line&mdash; reveal.js will get out of
date over time. It only takes a moment to update, but the gem has to
be republished: just let me know.</p>

<h2>Supplying a Config</h2>

<p>reveal-ck pays attention to a central configuration file. You can
create a file named <code>config.yml</code> in the same directory with your
slides files and put the following into it:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'>author:     &quot;Your Name&quot;
</span><span class='line'>title:      &quot;The Title of your Presentation&quot;
</span><span class='line'>theme:      &quot;night&quot;
</span><span class='line'>transition: &quot;default&quot;
</span></code></pre></td></tr></table></div></figure>


<p>This will change the <code>&lt;title&gt;</code> of the slides as you might expect, and
<code>theme</code> can be set to any of the available themes in reveal.js. Same
goes for <code>transition</code>. By adding this file and regenerating, you can
end up
<a href="../../files/posts/reveal-ck/simple-with-config/slides/index.html">with this result</a>.</p>

<h2>Bundling Up Images</h2>

<p>As with any HTML document, if you&rsquo;ve got an <code>&lt;img/&gt;</code> you can make the
<code>src</code> absolute. However, if you don&rsquo;t have (or don&rsquo;t want) images
hosted anywhere, you can also bundle them up with reveal-ck.</p>

<p>If you&rsquo;ve got a <code>slides.haml</code>, create an <code>images/</code> directory as its
peer and put your images in there. When <code>reveal-ck generate</code> runs,
anything in <code>images/</code> will be bundled up into the <code>slides/</code> directory.</p>

<p>In short, this means that you can reference those images with the
following:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='haml'><span class='line'><span class="nt">%section</span>
</span><span class='line'>  <span class="nt">%img</span><span class="p">{</span> <span class="ss">alt</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span> <span class="ss">src</span><span class="p">:</span> <span class="s2">&quot;images/my-image.png&quot;</span> <span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<h2>Displaying and Hosting</h2>

<p>If you are connecting your computer up to a projector and displaying
slides to an audience, you can simple open them in a browser.</p>

<p>If you want to make them accessible online, you get the benefits of
presenter mode (hit &ldquo;s&rdquo; while presenting) as well as being able to
view them from anywhere.</p>

<p>Because reveal.js slides are static content, you can generate the
<code>slides/</code> directory and place the contents anywhere using whatever
tools you prefer.</p>

<p>If you&rsquo;re already using Github, you should consider using Github
Pages. In short:</p>

<ul>
<li>Start tracking your project with git. You&rsquo;ll have a single <code>master</code>
branch initially.</li>
<li>When you generate your slides, add and commit everything in
<code>slides/</code></li>
<li>Create a new repository on Github. Push your <code>master</code> up to Github&rsquo;s
<code>master</code>.</li>
<li>Finally, also push your <code>master</code> up to Github&rsquo;s <code>gh-pages</code> branch.</li>
</ul>


<p>Because of how Github Pages works, if your username is <code>jedcn</code> and
your repository is <code>my-talk</code>, then the contents of your <code>gh-pages</code>
branch will be available at <a href="http://jedcn.github.io/my-talk/.">http://jedcn.github.io/my-talk/.</a> Slides
are generated in the <code>slides/</code> directory, so you will find your
content here: <a href="http://jedcn.github.io/my-talk/slides.">http://jedcn.github.io/my-talk/slides.</a></p>

<h2>More Help?</h2>

<p>Here&rsquo;s a <a href="http://jedcn.github.io/reveal-ck/">quick overview</a> to reveal-ck.</p>

<p>And here&rsquo;s a <a href="https://github.com/jedcn/reveal-ck/blob/master/doc/getting_started.md">Getting Started</a> page.</p>

<p>If these aren&rsquo;t enough, let me know what&rsquo;s missing.</p>

<h1>In Closing</h1>

<p>reveal.js is awesome.</p>

<p>Before I knew about it, I&rsquo;d be coding along in Emacs (or whatever) and
if I knew slides were in my future I&rsquo;d boot up Keynote (or whatever).</p>

<p>Now, with reveal.js, you can author slides without ever leaving your
favorite editor. They are plain text, so they can be easily managed in
source control. On top of that, they look great, are mobile aware, and
if you host them on the web, you can easily bring them anywhere.</p>

<p>Taking it one step further, I like using reveal-ck when dealing with
reveal.js because:</p>

<ul>
<li><p>reveal-ck allows me to isolate my content (the slides) from the 70+
files that come with reveal.js</p></li>
<li><p>reveal-ck allows me to focus right on my content (the
<code>slides.haml</code>).</p></li>
</ul>


<p>In short, reveal-ck takes less work to make a better presentation.</p>

<p>At any rate, I hope this helps. Let me know what you think.</p>

<h2>Resources</h2>

<ul>
<li><a href="http://lab.hakim.se/reveal-js/">reveal.js</a></li>
<li><a href="http://slid.es/">slid.es</a></li>
<li><a href="http://haml.info/">Haml</a></li>
<li><a href="http://haml.info/docs/yardoc/file.REFERENCE.html">Haml Reference</a></li>
<li><a href="http://haml.info/tutorial.html">Haml Tutorial</a></li>
<li><a href="http://rdoc.info/gems/slim/frames">Slim Reference</a></li>
<li><a href="http://slim-lang.com/">Slim Homepage</a></li>
<li><a href="http://jedcn.github.io/reveal-ck/">reveal-ck Overview</a></li>
<li><a href="https://github.com/jedcn/reveal-ck/blob/master/doc/getting_started.md">reveal-ck Getting Started</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Emacs]]></title>
    <link href="http://jedcn.com/posts/emacs/"/>
    <updated>2013-06-30T15:46:00-04:00</updated>
    <id>http://jedcn.com/posts/emacs</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>If you work with people that manipulate text for their livelihood
then, sooner or later, you will hear about either
<a href="https://en.wikipedia.org/wiki/Emacs">Emacs</a> or <a href="http://en.wikipedia.org/wiki/Vim_(text_editor)">Vim</a>.</p>

<p>Emacs is my editor of choice right now, but I also happen to be
surrounded by people that often ask: &ldquo;Why do you use Emacs?&rdquo;</p>

<p>If you&rsquo;re considering Emacs, or wondering why anyone would, this post
details <a href="https://github.com/jedcn/emacs-setup">my emacs configuration</a>, a few
resources for further reading, and some videos about standout
functionality that&rsquo;s present in emacs: <a href="http://vimeo.com/2871241">magit</a>
and <a href="http://www.youtube.com/watch?v=oJTwQvgfgMM">org-mode</a>.</p>

<h1>Background</h1>

<p>One great way to see what Emacs is all about is to watch
<a href="http://www.youtube.com/watch?v=p3Te_a-AGqM">this video</a>. The presenter,
<a href="https://github.com/magnars">Magnar Sveen</a>, is both adept at Emacs and
entertaining. It&rsquo;s a 20 minute whirlwind designed to show off some
cool features.</p>

<p>I self-identify as an emacs beginner, and according to
<a href="http://blog.vivekhaldar.com/post/3996068979/the-levels-of-emacs-proficiency">this post</a>, I&rsquo;m somewhere between a 2 and a 3
(out of a possible 6) in terms of mastery. That said- I&rsquo;ve taken care
to document my configuration using Literate Programming as
<a href="http://sachachua.com/blog/2012/06/literate-programming-emacs-configuration-file/">described here by Sacha Chua</a>.</p>

<p>This means that if you look at
<a href="https://github.com/jedcn/emacs-setup">my configuration</a>, you&rsquo;ll see the main
features of Emacs that I use. There&rsquo;s nothing special: outside of
plain old editing, I enjoy using magit and org-mode.</p>

<p>Both magit and org-mode merit further discussion.</p>

<h2>Magit</h2>

<p>If you use git (or are learning to use git), it&rsquo;s hard to overstate
how sweet magit is. This is especially so for its support of <code>git add
--interactive</code>. Here&rsquo;s a link to a screencast that
<a href="http://vimeo.com/2871241">provides a good overview</a> of what&rsquo;s generally
possible.</p>

<h2>Org Mode</h2>

<p>Moving onto Org-mode, it describes itself as:</p>

<blockquote><p>..for keeping notes, maintaining TODO lists, planning projects, and
authoring documents with a fast and effective plain-text system.</p></blockquote>

<p>There are a number of <a href="http://orgmode.org/worg/org-tutorials/">tutorials online</a>, and back in
2008 I remember being somewhat slack jawed at
<a href="http://www.youtube.com/watch?v=oJTwQvgfgMM">Carsten Dominik&rsquo;s talk about Org at Google</a>.</p>

<p>I use it mainly for tracking tasks, embedding snippets of code or
shell output, and taking notes through the day.</p>

<h2>Emacs Rocks!</h2>

<p>While we&rsquo;re talking about videos, the the same crew behind
<a href="http://www.youtube.com/watch?v=p3Te_a-AGqM">this video mentioned above</a> produce a
series of videos at <a href="http://emacsrocks.com">emacsrocks.com</a>.
<a href="https://github.com/magnars">Magnar&rsquo;s</a> approach is so light hearted, enthusiastic,
and entertaining that I couldn&rsquo;t help myself.</p>

<h1>Emacs Websites</h1>

<p>Aside from videos, there are a number of sites with pretty nice Emacs
content, and the ones that I check out regularly are:</p>

<ul>
<li><a href="http://sachachua.com/">http://sachachua.com</a></li>
<li><a href="http://whattheemacsd.com">http://whattheemacsd.com</a></li>
<li><a href="http://emacsrocks.com">http://emacsrocks.com/</a></li>
<li><a href="http://emacsredux.com/">http://emacsredux.com/</a></li>
</ul>


<p>And I also like
<a href="http://david.rothlis.net/emacs/howtolearn.html">David Rothlis&#8217; How to Learn Emacs</a> for
getting started.</p>

<h1>In Closing</h1>

<p>I know that Emacs isn&rsquo;t for everyone, and I know that there&rsquo;s a rather
large learning curve, but there&rsquo;s a bunch to enjoy and discover in
figuring this out.</p>

<p>If you read the following excerpt from
<a href="http://blog.vivekhaldar.com/post/31970017734/new-frontiers-in-text-editing">The New Frontiers in Text Editing</a> and find it
intriguing, I suggest you give Emacs or Vim a try:</p>

<blockquote><p>Overall, I think text editing is a solved problem. Text editors are
like wine. The older the better. You do not want a shiny new text
editor. You want the text editor that has been around long enough
and used by enough geeks that every conceivable pattern of
manipulating symbols on the screen has been thought of, and
crystallized into a re-usable pack.</p></blockquote>

<p>If you do go down that path and you&rsquo;d like to chat about Emacs
<a href="https://github.com/jedcn/emacs-setup">configuration stuff</a>, shoot me an email.</p>

<h2>Resources</h2>

<ul>
<li><a href="https://en.wikipedia.org/wiki/Emacs">Emacs on Wikipedia</a></li>
<li><a href="http://en.wikipedia.org/wiki/Vim_(text_editor)">Vim on Wikipedia</a></li>
<li><a href="https://github.com/jedcn/emacs-setup">My Emacs Setup</a></li>
<li><a href="http://vimeo.com/2871241">Magit Screencast on Vimeo</a></li>
<li><a href="https://github.com/magit/magit">Magit on Github</a></li>
<li><a href="http://www.youtube.com/watch?v=oJTwQvgfgMM">Cartsen Dominik&rsquo;s Org talk at Google</a></li>
<li><a href="http://orgmode.org/worg/org-tutorials/">Org Tutorials</a></li>
<li><a href="http://blog.vivekhaldar.com/post/3996068979/the-levels-of-emacs-proficiency">Vivek Haldar&rsquo;s Levels of Emacs Proficiency</a></li>
<li><a href="http://blog.vivekhaldar.com/post/31970017734/new-frontiers-in-text-editing">Vivek Haldar&rsquo;s New Frontiers in Text Editing</a></li>
<li><a href="http://emacsrocks.com">Emacs Rocks!</a></li>
<li><a href="http://whattheemacsd.com">What The Emacs.d</a></li>
<li><a href="http://www.youtube.com/watch?v=p3Te_a-AGqM">Magnar Sveen at Web Rebels 2012</a></li>
<li><a href="https://github.com/magnars">Magnar Sveen&rsquo;s Github Page</a></li>
<li><a href="http://emacsredux.com/">Emacs Redux</a></li>
<li><a href="http://david.rothlis.net/emacs/howtolearn.html">David Rothlis&#8217; How To Learn Emacs</a></li>
<li><a href="http://sachachua.com/">Sacha Chua&rsquo;s Blog</a></li>
<li><a href="http://sachachua.com/blog/2012/06/literate-programming-emacs-configuration-file/">Sacha Chua&rsquo;s Literate Emacs Config</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Mac Install]]></title>
    <link href="http://jedcn.com/posts/mac-install/"/>
    <updated>2013-06-25T15:55:00-04:00</updated>
    <id>http://jedcn.com/posts/mac-install</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>These notes describe how I setup a Mac.</p>

<p>For now, they take the form of individual commands that I run and
software that I install.</p>

<p>Hopefully, someday, they&rsquo;ll be automated ala <a href="http://boxen.github.com/">Boxen</a>.</p>

<h1>Background</h1>

<p>I am fortunate to find myself working at a company that provides me
with a nice computer setup.</p>

<p>As of May 2013, this means I&rsquo;m on MacOS, and I recently went through a
re-install. As I was doing this, I was hoping to take a closer look at
<a href="http://boxen.github.com/">Github&rsquo;s Boxen</a>, but time was short and I missed out.</p>

<p>Instead of looking further into Boxen, I took notes as I got up and
running, and these are those notes.</p>

<h1>Installation Notes</h1>

<p>At a high level, here&rsquo;s what I do:</p>

<h1>Step 1: xCode</h1>

<p>This is accomplished via the AppStore. I log in with my personal id,
and at the time of my most recent install the latest version of xcode
was 4.6.2.</p>

<h1>Step 2: Brew</h1>

<p>Next up is <a href="http://mxcl.github.io/homebrew/">Homebrew</a>.</p>

<p>I follow the instructions in the link above, which indicate that I
should do this:</p>

<pre><code>ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
</code></pre>

<h2>Step 2.1: brew + git</h2>

<pre><code>brew install git
</code></pre>

<p>Brew puts <code>git</code> into <code>/usr/local/bin</code>, which, for now, contains stuff
that I prefer over <code>/usr/bin</code> (ie: brew git vs. apple git), so I
modified my PATH appropriately:</p>

<pre><code>#
# I added this to my .bash_profile
PATH=/usr/local/bin:$PATH
</code></pre>

<p>Once you&rsquo;ve got <code>git</code>:</p>

<pre><code>git config --global user.name "your name"
git config --global user.email "your@email.com"
</code></pre>

<p>While browsing through Github&rsquo;s
<a href="https://help.github.com/articles/set-up-git">help on setting up git</a> I became aware of this
configuration possibility:</p>

<pre><code>git config --global credential.helper osxkeychain
</code></pre>

<p>I set this up for short-term convenience, but I also generate a
keypair and register the public key with github as well.</p>

<p>I make sure to setup colors:</p>

<pre><code>git config --global color.ui true
</code></pre>

<p>And finally, I make it so that when I commit from the command line
(this happens rarely because I&rsquo;m normally using <a href="http://www.emacswiki.org/emacs/Magit">magit</a>), I can supply
the message via emacs:</p>

<pre><code>git config --global core.editor /usr/local/bin/emacsclient
</code></pre>

<p>I get emacs from brew (described below, and so I get <code>emacsclient</code>
from <code>/usr/local/bin</code>).</p>

<h3>Global Git Config vs. Local Git Config</h3>

<p>As a side note, I find myself in a situation where I usually want 90%
of my projects on my machine to use my main git config, but for the
remaining 10% I&rsquo;d like to use a different email address. I achieve
that through mixing global and local config options, which work (as I
understand) as follows:</p>

<p>If you&rsquo;d like to have configuration options specified on a
project-by-project basis, you can setup configuration local to a
project by cd&#8217;ing into that project and running something like:</p>

<pre><code>git config --local key value
</code></pre>

<p>For example, to change your <code>user.email</code> on a specific project, cd
into that project and run:</p>

<pre><code> git config --local user.email "northridge@gmail.com"
</code></pre>

<h2>Step 2.2: brew + ack/ag</h2>

<p>These are a must for searching through code bases. I lean toward <code>ack</code>
right now, but I&rsquo;ve been keeping an eye on <code>ag</code>.</p>

<pre><code>brew install ack
brew install ag
</code></pre>

<h2>Step 2.3: brew + tree</h2>

<pre><code>brew install tree
</code></pre>

<h2>Step 2.4: brew + markdown</h2>

<p>My interest in a command line markdown is fueled by my editor. It
provides preview capabilities that rely on a command line markdown
processor.</p>

<pre><code>brew install markdown
</code></pre>

<h2>Step 2.5: brew + node</h2>

<pre><code>brew install node
</code></pre>

<h2>Step 2.6: brew + mysql</h2>

<pre><code>brew install mysql
</code></pre>

<h2>Step 2.6: brew + wget</h2>

<pre><code>brew install wget
</code></pre>

<h2>Step 2.6: brew + emacs</h2>

<pre><code>brew install emacs --cocoa
ln -s /usr/local/Cellar/emacs/24.3/Emacs.app /Applications
</code></pre>

<h1>Screen Zoom</h1>

<p>I really, really enjoy holding down <code>control</code> and zooming in or out
with my trackpad. This was made harder to enable with Mountain Lion,
but it&rsquo;s handily setup in just a moment following
<a href="http://bkbeachlabs.com/blog/screen-zoom-in-os-x-mountain-lion/">these instructions from bkbeachlabs.com here</a></p>

<h1>Remap CAPS LOCK</h1>

<p>To avoid the dreaded <a href="https://en.wikipedia.org/wiki/Emacs#Emacs_pinky">Emacs Pinky</a> I re-map
<code>CAPSLOCK</code> to <code>CONTROL</code> each time I land on a new computer.</p>

<p>I&rsquo;ve followed different instructions in the past, but here are the
ones that pointed me in the right direction:
<a href="http://stackoverflow.com/questions/162896/emacs-on-mac-os-x-leopard-key-bindings">random question/answer on stackoverflow.com</a>.</p>

<p>Remember to do both your computer and your bluetooth keyboard. Look
for the &ldquo;Select Keyboard&rdquo; combo box on the &ldquo;Modifier Keys..&rdquo; dialog.</p>

<h1>Install Slate</h1>

<p>Here&rsquo;s how I get slate itself:</p>

<pre><code>cd /Applications &amp;&amp; curl http://www.ninjamonkeysoftware.com/slate/versions/slate-latest.tar.gz | tar -xz
</code></pre>

<p>And then how I setup the configuration:</p>

<pre><code>mkdir -p ~/c/personal
cd ~/c/personal
git clone https://github.com/jedcn/getting-started-with-slate.git
cd ~
ln -s c/personal/getting-started-with-slate/.slate .slate
</code></pre>

<p>Then I started up Slate.</p>

<p>For additional notes about Slate, <a href="http://jedcn.com/posts/slate/">check out this post</a>.</p>

<h1>iTerm2</h1>

<p>I&rsquo;ve been sticking with the default Terminal recently, but I usually
grab iTerm2 before too long. This time around I got it from here:
<a href="https://code.google.com/p/iterm2/downloads/list">iterm2 downloads list</a></p>

<p>And then, if I unzipped it and saw Downloads/iTerm.app I ran:</p>

<pre><code>mv ~/Downloads/iTerm.app /Applications
</code></pre>

<h1>Pandoc</h1>

<p>I installed Pandoc for the first time recently, and it was.. exciting.</p>

<p>I pursued Pandoc (and BasicTeX) for the sole purpose of, within emacs,
being able to generate pdf documents ala <code>org-export-as-pdf</code>.</p>

<p>I&rsquo;m not sure this is worth the effort (particularly the BasicTeX
part), but, anyway..</p>

<p>I started here:
<a href="http://johnmacfarlane.net/pandoc/installing.html">pandoc install instructions</a>.</p>

<p>Which directed me to this page for pandoc itself where I grabbed the
.dmg: <a href="https://code.google.com/p/pandoc/downloads/list">pandoc downloads list</a>.</p>

<h2>Pandoc: BasicTeX</h2>

<p>Here is where I found BasicTeX:
<a href="http://www.tug.org/mactex/morepackages.html">the packages section</a>, as recommended by the
Pandoc install pages.</p>

<p>Things got complicated, quickly, with BasicTeX.</p>

<p>They tell you to read through the installation instructions in this
<a href="http://pages.uoregon.edu/koch/BasicTeX.pdf">document</a>, and I found them worthwhile.</p>

<p>Here&rsquo;s what I did:</p>

<p>Download the package for BasicTeX. There&rsquo;s an installer. After you run
there&rsquo;s a directory that&rsquo;s been created at
<code>/usr/local/textlive/2013basic</code></p>

<p>If you cd into it, and then run <code>sudo ./install-tl</code>, you&rsquo;ll be
presented with a text based wizard. I ran the following cryptic
commands:</p>

<pre><code>s, then a, then r
o, then r, then r
d, then 7, then ~/Library/texmf
</code></pre>

<p>Then I pressed <code>i</code> to run the installation. Whew. Time to figure out
boxen, because I&rsquo;m not sure I&rsquo;ll be able to get there again.</p>

<p>There&rsquo;s more tweaking to Emacs to make it aware of where to find
<code>pdflatex</code>, but that&rsquo;s for another time.</p>

<p>At any rate, I then ran the following commands to install various
LaTeX styles:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sudo tlmgr install wrapfig
</span><span class='line'>sudo tlmgr install soul
</span><span class='line'>sudo tlmgr install marvosym
</span><span class='line'>sudo tlmgr install wasysym</span></code></pre></td></tr></table></div></figure>


<h1>Conclusion</h1>

<p>It&rsquo;s not pretty, but it&rsquo;s a start. Hopefully I&rsquo;ll move on to
automating this soon.</p>

<h1>Resources</h1>

<ul>
<li><a href="http://boxen.github.com/">Github&rsquo;s Boxen</a></li>
<li><a href="http://mxcl.github.io/homebrew/">Homebrew</a></li>
<li><a href="https://help.github.com/articles/set-up-git">Github&rsquo;s Help on Git Setup</a></li>
<li><a href="http://www.emacswiki.org/emacs/Magit">Magit</a></li>
<li><a href="http://bkbeachlabs.com/blog/screen-zoom-in-os-x-mountain-lion/">Instructions for Screen Zoom</a></li>
<li><a href="https://en.wikipedia.org/wiki/Emacs#Emacs_pinky">Wikipedia&rsquo;s Entry for Emacs Pinky</a></li>
<li><a href="http://stackoverflow.com/questions/162896/emacs-on-mac-os-x-leopard-key-bindings">Stackoverflow Entry for Emacs Keybindings on Macos</a></li>
<li><a href="http://jedcn.com/posts/slate/">jedcn&rsquo;s Slate Entry</a></li>
<li><a href="http://johnmacfarlane.net/pandoc/installing.html">Pandoc Install Instructions</a></li>
<li><a href="https://code.google.com/p/pandoc/downloads/list">Pandoc Downloads</a></li>
<li><a href="http://www.tug.org/mactex/morepackages.html">MacTeX BasicTeX</a></li>
<li><a href="http://pages.uoregon.edu/koch/BasicTeX.pdf">BasicTeX Install Notes</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Rake]]></title>
    <link href="http://jedcn.com/posts/rake/"/>
    <updated>2013-04-03T00:00:00-04:00</updated>
    <id>http://jedcn.com/posts/rake</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>If you started with Ruby and you&rsquo;re still around a month later, you
should spend a couple of hours and learn the basics of Rake. It&rsquo;s a
venerable item in the Ruby toolkit, and if you haven&rsquo;t used tools like
<code>make</code> before you&rsquo;re in for a treat.</p>

<h1>Background</h1>

<p>Rake describes itself as a <em>A make-like build utility for Ruby,</em> and
you might think it&rsquo;s limited to building &ldquo;code,&rdquo; but that&rsquo;s not
so. That&rsquo;s just the beginning. So long as you keep your mind open, and
remember that it&rsquo;s Ruby under the covers, you can keep using it to
&ldquo;build&rdquo; &ldquo;things&rdquo; that have nothing to do with code.</p>

<h1>Getting Started</h1>

<p>To get going, watch these two videos from Jim Weirich, the inventor of
Rake:</p>

<ul>
<li><a href="http://confreaks.com/videos/899-railsconf2012-basic-rake">Basic Rake by Jim Weirich at RailsConf 2012</a></li>
<li><a href="http://confreaks.com/videos/988-goruco2012-power-rake">Power Rake by Jim Weirich at Gotham Ruby Conf 2012</a></li>
</ul>


<p>These talks are well done, and a great investment of your time.</p>

<h1>Basically Good Things to Know</h1>

<p>Once you&rsquo;ve watched the videos, if you find yourself on a project
using Rake, you&rsquo;ll need to know about the tasks that are available to
you and where to find the source code behind them.</p>

<h2>What tasks exist?</h2>

<ul>
<li><p><code>rake -T</code> shows all described rake tasks</p></li>
<li><p><code>rake -T whatever</code> shows all described rake tasks beginning with
whatever</p></li>
<li><p><code>rake -P</code> shows all rake tasks and their dependencies</p></li>
<li><p><code>rake -W whatever</code> shows where the tasks beginning with whatever are
defined.</p></li>
</ul>


<p>As a user of Rake, I am sometimes surprised by the notion that if a
task doesn&rsquo;t have a description, then it doesn&rsquo;t appear in the output
of <code>rake -T</code> or <code>rake -W</code>. One of these (<code>-T</code>) is intentional, while
the other (<code>-W</code>) is a bug, and will be fixed sooner or later.</p>

<h2>Where&rsquo;s the source?</h2>

<p>The fastest way to get up to speed with Rake is to read Rake code.</p>

<p>If <code>rake -W</code> isn&rsquo;t helping you find source, or you don&rsquo;t have a
specific command to look for, you can generally find Rake tasks in the
following locations:</p>

<ul>
<li>The Rakefile at the root of your project</li>
<li>Files ending in &ldquo;.rake&rdquo; within the <code>rakelib/</code> directory underneath
the root of your project</li>
<li>Files ending in &ldquo;.rake&rdquo; within the <code>lib/tasks/</code> directory (if you&rsquo;re
using Rails)</li>
<li>Embedded within gems that you&rsquo;re using. These are usually the most
obscure to track down only because they aren&rsquo;t explicitly defined
nearby.</li>
</ul>


<h3>What is going on here?</h3>

<p>Once you do manage to track down the definition of a rake task or two,
the first time you read through Rakefiles there&rsquo;s an element of
mystery.</p>

<p>It can be a rather terse DSL, which you&rsquo;ll probably come to appreciate
over time, but initially, leaves you thinking &ldquo;What just happened?&rdquo;</p>

<p>Be sure to watch the videos above (with an eye for <code>FileList</code>s and the
<code>file</code> and <code>directory</code> tasks) and remember to hang in there.</p>

<h1>FileLists</h1>

<p>One specific piece of Rake mystery has to do with two things named
<code>CLEAN</code> and <code>CLOBBER</code>. These are references to FileLists in Rakefiles.</p>

<p>FileLists allows you to describe a set of files, and new instances of
it are commonly created with <code>[]</code> rather than an explicit <code>.new</code>:</p>

<p>You can hold off on learning about FileLists until you want to clean
stuff up or start writing tasks that operate on sets of files.</p>

<p>At any rate, don&rsquo;t slug through this stuff: the path to happiness here
is to watch the videos and then follow this link through to the
<a href="http://rake.rubyforge.org/classes/Rake/FileList.html">documentation</a>.</p>

<h1>Other Things to Note</h1>

<p>Many people have written oodles about Rake.</p>

<p>Rather than go down that path again, I&rsquo;ll stop and say that sooner or
later you you should check out:</p>

<ul>
<li><p>How Rake handles accessing environment variables, specifically how
it simulates <code>ENV['NAME']</code> if you write run this <code>rake blah
NAME=value</code></p></li>
<li><p>How Rake handles global Rakefiles (tasks that live outside of any
given project) via <code>rake -g</code></p></li>
</ul>


<h1>In Closing</h1>

<p>Rake has been around for a long time, and there&rsquo;s a bunch to
learn. However, you can get started initially with just a few hours
and this investment will pay itself off within a week or two, and then
only keep paying dividends.</p>

<p>Because it&rsquo;s so well known, a number of tools claim that they are
easier to understand because they follow a &lsquo;rake like syntax.&rsquo; This
means taking the time to understand Rake now has other, non-rake
benefits as well.</p>

<h2>Resources</h2>

<ul>
<li><a href="http://confreaks.com/videos/899-railsconf2012-basic-rake">Basic Rake Video on Confreaks</a></li>
<li><a href="http://confreaks.com/videos/988-goruco2012-power-rake">Power Rake Video on Confreaks</a></li>
<li><a href="http://en.wikipedia.org/wiki/Rake_%28software%29">Wikipedia for Rake</a></li>
<li><a href="http://www.stuartellis.eu/articles/rake/">Stuart Ellis&rsquo;s &lsquo;Using Rake to Automate Tasks&rsquo;</a></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Kindness]]></title>
    <link href="http://jedcn.com/posts/kindness/"/>
    <updated>2013-04-01T00:00:00-04:00</updated>
    <id>http://jedcn.com/posts/kindness</id>
    <content type="html"><![CDATA[<p>Regardless of <a href="http://quoteinvestigator.com/2010/06/29/be-kind/">who said it</a>, I live by the
following:</p>

<blockquote><p>Be Kind; Everyone You Meet is Fighting a Hard Battle.</p></blockquote>

<p>Life is too short, and people carry around more than you know.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Slate]]></title>
    <link href="http://jedcn.com/posts/slate/"/>
    <updated>2013-02-27T00:00:00-05:00</updated>
    <id>http://jedcn.com/posts/slate</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<ul>
<li>What <a href="https://github.com/jigish/slate">Slate</a>, does, and</li>
<li>Why you should try it today, and</li>
<li>How to make it happen in less than 10-15 minutes.</li>
</ul>


<p>Managing windows is an integral part of almost all computer sessions:
you switch between them, change how large your windows are are, and
(if you&rsquo;re super lucky) move them between different displays.</p>

<p>Slate is a Window Management Application.</p>

<p>Slate provides configurable key bindings that give you control over
your windows. With a single key press, you can switch between
applications, make windows change to a certain size, or jump between
displays.</p>

<p>If you&rsquo;re not already using an application that provides these
benefits, you should check out
<a href="https://github.com/jedcn/getting-started-with-slate">this write-up I created for getting started with Slate</a>.</p>

<h1>Why should you care about this?</h1>

<p>You might not. But..</p>

<h2>Window Management takes time</h2>

<p>If you&rsquo;re not using an application like <a href="https://github.com/jigish/slate">Slate</a>, try counting
up the amount of time you spend switching between, and managing,
windows.</p>

<p>Switching between applications or changing the size of a window
necessarily requires you to stop your train of thought and engage in a
trivial and error prone task.</p>

<p>The total time isn&rsquo;t bad: 2 seconds, maybe 5 seconds if you make a
mistake, but you do this every day, dozens or maybe even hundreds of
times.</p>

<p>No one benefits from this. Not the designer. Not the developer. Not
the writer. Not the artist. Not the scientist.</p>

<p>What&rsquo;s the alternative?</p>

<p>With a little work, you can make window management as second nature
for you as typing is. Once you learn to type, you don&rsquo;t think about
typing: your fingers start going and words appear.</p>

<p>The same can be true for everything to do with windows: soon you&rsquo;ll be
in a situation where you start typing and windows start flying around.</p>

<p>If you&rsquo;re still not sold,</p>

<h2>Presentations take a whole lot of focus</h2>

<p>When you are giving a presentation and your computer is displaying
something on a big screen in front of a dozen or more people, you
likely want to concentrate on your presentation and its content.</p>

<p>In particular, you don&rsquo;t want to lose any of your focus cycling
between applications, moving windows around, or manually adjusting
their size so that everything fits on the screen. Especially not in
front of 10 people. Or 20. Or 100.</p>

<h2>Next Steps</h2>

<p>If you&rsquo;re willing to give Slate a try, I recommend starting with a
write-up I made called
<a href="https://github.com/jedcn/getting-started-with-slate">Getting started with Slate</a>. I&rsquo;m
suggesting this path because there are a bunch of configuration
options and I initially found them overwhelming.</p>

<p>The idea of this write-up is that it should get you up and running in
15 minutes. If it doesn&rsquo;t, send me an email on where I went wrong and
I&rsquo;ll see if I can help you out.</p>

<p>If Slate doesn&rsquo;t seem right for you, but you are interested in window
management, then start googling around for alternatives. There are a
bunch of them and many have really slick user interfaces and videos
showing exactly what you can accomplish.</p>

<p>Either way- hopefully you&rsquo;ll check this out: I couldn&rsquo;t go back to
working without it.</p>

<h2>Resources</h2>

<ul>
<li><p>You can search for
<a href="https://www.google.com/search?q=site%3Anews.ycombinator.com+slate">&lsquo;slate&rsquo;</a> or
<a href="https://www.google.com/search?q=site%3Anews.ycombinator.com+window+manager">&lsquo;window manager&rsquo;</a> on Hacker News.</p></li>
<li><p>Slate isn&rsquo;t the only window manager in town. I&rsquo;ve also heard good
things about <a href="http://www.irradiatedsoftware.com/sizeup/">Size-Up</a> and <a href="http://mizage.com/divvy/">Divvy</a>.</p></li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nearly Free Jekyll]]></title>
    <link href="http://jedcn.com/posts/nearly-free-jekyll/"/>
    <updated>2013-02-23T00:00:00-05:00</updated>
    <id>http://jedcn.com/posts/nearly-free-jekyll</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p>How to get a <a href="https://github.com/mojombo/jekyll">Jekyll</a> generated site up on
<a href="https://www.nearlyfreespeech.net/">Nearly Free Speech</a> with minimal hassle.</p>

<h2>Update</h2>

<p>This site used to be created with Jekyll, and I wrote this to remind
myself of what it took to &ldquo;bootstrap&rdquo; the site. That said, I&rsquo;ve since
switched to Octopress. I still generate locally, and I still rsync
stuff up.</p>

<h1>Background</h1>

<p><a href="https://www.nearlyfreespeech.net/">Nearly Free Speech</a> is a popular hosting provider that&rsquo;s
good at hosting static content. It isn&rsquo;t too expensive and gives you
the ability to publish (or un-publish) whatever you want.</p>

<p><a href="https://github.com/mojombo/jekyll">Jekyll</a> is a static site generator.</p>

<p>There are many strategies for publishing a site that you&rsquo;ve built with
Jekyll.</p>

<p>Which strategy you pick will depend on your publishing platform /
hosting provider.</p>

<p>However, if you&rsquo;re using Nearly Free Speech, my suggestion is that you
use straight-up <strong>rsync</strong>.</p>

<p>In particular, avoid the lure of using things like a <a href="http://git-scm.com/">git</a>
post-receive or post-update hook. If you&rsquo;ve already got a local setup
running the way you like with Jekyll <em>and</em> you don&rsquo;t explicitly
control the server-side environment that you&rsquo;re publishing into, then
it is:</p>

<ul>
<li>less overall work,</li>
<li>less error-prone, and</li>
<li>easier to troubleshoot</li>
</ul>


<p>a process where you upload your generated site.</p>

<h1>Suggested Workflow</h1>

<ul>
<li>Generate your site locally, and</li>
<li>Preview it locally, and</li>
<li>Once you&rsquo;re happy with what you&rsquo;ve got, use the unix utility rsync
to update NFSN&rsquo;s <code>/home/public</code> with your local <code>_site</code></li>
</ul>


<h1>Getting Started</h1>

<h2>Assumptions</h2>

<p>Before you begin, you should create a site with <a href="https://github.com/mojombo/jekyll">jekyll</a> and
then start tracking it in <a href="http://git-scm.com/">git</a>.</p>

<p>You should be able to preview this site by running <code>jekyll
--server</code> and be ready to make this site available on the web.</p>

<p>You should have signed up with Nearly Free Speech so that you&rsquo;ve got
an account and ssh access to a box.</p>

<h2>RSync</h2>

<p>If you run <code>jekyll --no-auto</code> it&rsquo;ll regenerate a fresh version of
your site in the <code>_site</code> directory.</p>

<p>Once you&rsquo;ve got everything you want in <code>_site</code> you can rsync it
up to Nearly Free Speech.</p>

<p>Putting the two commands together:</p>

<div>
  <pre><code class='console'>$ jekyll --no-auto
$ rsync -crz --delete _site/ &lt;NFSN_LOGIN&gt;@ssh.phx.nearlyfreespeech.net:/home/public</code></pre>
</div>


<p>If you put this into a Rakefile you wouldn&rsquo;t have to remember the
specific command line options for rsync or to regenerate the site each
time:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">task</span> <span class="ss">:deploy</span> <span class="k">do</span>
</span><span class='line'>  <span class="n">sh</span> <span class="s2">&quot;jekyll --no-auto&quot;</span>
</span><span class='line'>  <span class="n">user</span> <span class="o">=</span> <span class="s1">&#39;your_nfsn_ssh_login&#39;</span>
</span><span class='line'>  <span class="n">server</span> <span class="o">=</span> <span class="s1">&#39;ssh.phx.nearlyfreespeech.net&#39;</span>
</span><span class='line'>  <span class="n">sh</span> <span class="s2">&quot;rsync -icrz --delete _site/ </span><span class="si">#{</span><span class="n">user</span><span class="si">}</span><span class="s2">@</span><span class="si">#{</span><span class="n">server</span><span class="si">}</span><span class="s2">:/home/public&quot;</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>And each time you wanted to deploy you&rsquo;d type:</p>

<div>
  <pre><code class='console'>$ rake deploy</code></pre>
</div>


<h2>Resources</h2>

<ul>
<li>The <a href="https://github.com/mojombo/jekyll/wiki/Deployment">Jekyll Deploy Wiki</a> discusses rsync.</li>
<li>Nathan Grigg has a blog entry all about
<a href="http://nb.nathanamy.org/2012/04/rsyncing-jekyll/">rsyncing with jekyll</a> which, in particular,
revealed the notion of rsync&rsquo;s <code>--checksum</code></li>
</ul>

]]></content>
  </entry>
  
</feed>
