<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>tag:airbladesoftware.com,2009:/</id>
  <title type="text">AirBlade Software</title>
  <updated>2010-09-03T00:00:00+00:00</updated>
  <generator uri="http://effectif.com/nesta">Nesta, modified by AirBlade</generator>
  <link href="http://airbladesoftware.com/feed/notes.xml" rel="self"/>
  <link href="http://airbladesoftware.com" rel="alternate"/>
  <subtitle type="text"></subtitle>
  <icon>/attachments/favicon.ico</icon>
  <author>
    <name>Andy Stewart</name>
    <uri>http://airbladesoftware.com</uri>
    <email>boss@airbladesoftware.com</email>
  </author>
  <entry>
    <id>tag:airbladesoftware.com,2010-09-03:/notes/overnight-success</id>
    <title>Overnight Success</title>
    <updated>2010-09-03T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/overnight-success" rel="alternate"/>
    <content type="html">&lt;blockquote&gt;
&lt;p&gt;Timing, perseverance, and ten years of trying will eventually make you look like an overnight success.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;cite&gt;&lt;a href="http://www.bizstone.com/2010/09/timing-lessons.html"&gt;Biz Stone, co-founder of Twitter&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>
    <published>2010-09-03T00:00:00+00:00</published>
    <category term="Quotations"/>
    <category term="Business"/>
  </entry>
  <entry>
    <id>tag:airbladesoftware.com,2010-08-31:/notes/quicksilver-out-alfred-in</id>
    <title>Quicksilver Out, Alfred In</title>
    <updated>2010-08-31T13:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/quicksilver-out-alfred-in" rel="alternate"/>
    <content type="html">&lt;p&gt;Until recently I regarded &lt;a href="http://www.blacktree.com/"&gt;Quicksilver&lt;/a&gt; as vital.  However its &lt;a href="http://arstechnica.com/apple/news/2009/01/quicksilvers-jitkoff-moves-on-to-google-quick-search-box.ars"&gt;creator has stopped working on it&lt;/a&gt; and, although the code is now &lt;a href="http://github.com/tiennou/blacktree-alchemy"&gt;open source&lt;/a&gt;, I&amp;rsquo;ve found it getting buggier and slower.  It stops working every time I upgrade it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.alfredapp.com"&gt;&lt;img src='/attachments/alfred-logo.png' class='frame left' alt='Alfred logo' title='Alfred logo' /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead I now use &lt;a href="http://www.alfredapp.com/"&gt;Alfred&lt;/a&gt;.  It&amp;rsquo;s super fast, stable, and easy on the eye.  The team seems to have good momentum and they frequently release improvements.  I&amp;rsquo;ve been using Alfred for a few weeks now and wouldn&amp;rsquo;t go back.&lt;/p&gt;

&lt;p&gt;One feature Quicksilver has, but Alfred doesn&amp;rsquo;t (yet), is the ability to assign actions to keys.  I bind the function keys to various apps and scripts &amp;mdash; they&amp;rsquo;re ingrained in my muscle memory &amp;mdash; and until Alfred supports this I need another way.  Here&amp;rsquo;s my &lt;a href="http://airbladesoftware.com/notes/binding-osx-services-to-function-keys"&gt;solution&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id='comments'&gt;Comments&lt;/h2&gt;




&lt;div class='comment'&gt;
&lt;p&gt;Did you check out &lt;a href='http://www.obdev.at/products/launchbar/index.html'&gt;Launchbar&lt;/a&gt; at all?  It's awesome &amp;mdash; I can't live without it!&lt;/p&gt;
&lt;cite&gt;&lt;a href='http://twitter.com/lylo/status/22837565144'&gt;Olly Headey&lt;/a&gt; &amp;#x2022; 3 September 2010&lt;/cite&gt;
&lt;/div&gt;




&lt;div class='comment'&gt;
&lt;p&gt;No I didn&amp;rsquo;t&amp;hellip;that also looks v good.  I'm sticking with Alfred though ;)&lt;/p&gt;
&lt;cite&gt;&lt;a href='http://twitter.com/airblade/status/22869001623'&gt;Andy Stewart&lt;/a&gt; &amp;#x2022; 3 September 2010&lt;/cite&gt;
&lt;/div&gt;

</content>
    <published>2010-08-31T13:00:00+00:00</published>
    <category term="OS X"/>
  </entry>
  <entry>
    <id>tag:airbladesoftware.com,2010-08-31:/notes/binding-osx-services-to-function-keys</id>
    <title>Binding OS X Services to Function Keys</title>
    <updated>2010-08-31T11:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/binding-osx-services-to-function-keys" rel="alternate"/>
    <content type="html">&lt;p&gt;Snow Leopard revamped the System Services and made them much more useful.  I wanted to bind a few simple Automator workflows and Ruby scripts to the function keys so I could run them with a single keypress.&lt;/p&gt;

&lt;p&gt;Unfortunately &lt;a href="http://superuser.com/questions/72468/how-can-i-program-the-function-keys-on-my-macbook"&gt;it seems&lt;/a&gt; there&amp;rsquo;s &lt;a href="http://discussions.apple.com/message.jspa?messageID=10898253#10898253"&gt;a bug&lt;/a&gt; in Snow Leopard which means you can&amp;rsquo;t assign services to function keys in the Keyboard Shortcuts panel.&lt;/p&gt;

&lt;p&gt;Happily Daniel Jalkut&amp;rsquo;s &lt;a href="http://www.red-sweater.com/fastscripts/"&gt;FastScripts&lt;/a&gt; solves the problem.&lt;/p&gt;

&lt;p&gt;By default FastScripts picks up your scripts in &lt;code&gt;~/Library/Scripts&lt;/code&gt;.  To get it to see your services, you need to alias them from &lt;code&gt;~/Library/Services&lt;/code&gt; to &lt;code&gt;~/Library/Scripts&lt;/code&gt;.  A unix symlink won&amp;rsquo;t work; it has to be a Finder alias (hold down cmd and option while dragging an item in the Finder).&lt;/p&gt;

&lt;p&gt;Once FastScripts can see your services, you can bind them to the function keys in FastScripts Preferences &gt; Script Shortcuts.&lt;/p&gt;
</content>
    <published>2010-08-31T11:00:00+00:00</published>
    <category term="OS X"/>
  </entry>
  <entry>
    <id>tag:airbladesoftware.com,2010-08-13:/notes/blog-upgraded</id>
    <title>Blog Upgraded.  Finally</title>
    <updated>2010-08-13T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/blog-upgraded" rel="alternate"/>
    <content type="html">&lt;p&gt;Today I replaced my oldest production Rails app: this blog.  For the past four years I&amp;rsquo;ve been running Mongrel 0.7.3 on Rails 1.2.3 and, while it was just what I needed in 2006, I&amp;rsquo;m delighted to spin up &lt;a href="http://effectif.com/nesta"&gt;Nesta&lt;/a&gt; instead.  I also replaced a more recent Rails app which ran the non-blog parts of the site.&lt;/p&gt;

&lt;p&gt;Now I have half a megabyte of text files instead of a 142MB MySQL database; one app instead of two; the low memory usage of Sinatra under Passenger rather than 70-150 MB of Mongrel; and the colour blue (more below).&lt;/p&gt;

&lt;p&gt;I had two questions when deciding what to use: static or dynamic?  And comments or no comments?&lt;/p&gt;

&lt;h2&gt;Static versus dynamic&lt;/h2&gt;

&lt;p&gt;A blog is not complicated: you have articles, perhaps comments, a few fixed pages, and maybe some tags.  Indeed &lt;a href="http://loudthinking.com"&gt;DHH&lt;/a&gt; marketed Rails heavily with a &lt;a href="http://rubyonrails.org/screencasts"&gt;create a blog in 15 minutes&lt;/a&gt; video.  It&amp;rsquo;s easy to write your own blog.&lt;/p&gt;

&lt;p&gt;Yet blogs are not interactive, apart from comments, so it&amp;rsquo;s more efficient to generate their static HTML on deployment and leave it at that.  No code is faster than no code.  Furthermore you can edit your articles in your &lt;a href="http://airbladesoftware.com/notes/smash-into-vim-part-i"&gt;favourite text editor&lt;/a&gt;, use proper version control, and so on.&lt;/p&gt;

&lt;p&gt;But as &lt;a href="http://blog.peepcode.com/tutorials/2010/about-this-blog"&gt;Geoffrey Grosenbach said&lt;/a&gt;, &lt;q&gt;I find it more natural to write it in a dynamic style.&lt;/q&gt;&lt;/p&gt;

&lt;h2&gt;Comment or no comment?&lt;/h2&gt;

&lt;p&gt;There are good reasons for and against comments.  I always like being able to comment on others' blogs and I appreciate all the comments people have left on mine, especially the last one:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;You, sir, are a scholar and a gentleman.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;cite&gt;&lt;a href="http://airbladesoftware.com/notes/a-paper-trail-for-your-models"&gt;William Jones&lt;/a&gt; (bottom of the page)&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;However I&amp;rsquo;ve come round to &lt;a href="http://toolmantim.com/thoughts/refreshed-realigned-and-ready-for-09"&gt;Tim Lucas&amp;rsquo;s view&lt;/a&gt; (&amp;#167; Comments and Discussion).  From now on you can &lt;a href="mailto:boss@airbladesoftware.com"&gt;email me&lt;/a&gt; or &lt;a href="http://twitter.com/airblade"&gt;catch me on Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Nesta&lt;/h2&gt;

&lt;p&gt;So I went with &lt;a href="http://effectif.com/nesta"&gt;Nesta&lt;/a&gt;.  I&amp;rsquo;d already customised Nesta &lt;a href="http://news.sparklehq.com"&gt;elsewhere&lt;/a&gt; and I wanted to customise it differently this time.  Rather than fork Nesta twice I&amp;rsquo;m maintaining long-running branches in Git.  It works well.&lt;/p&gt;

&lt;p&gt;I found the distinction between pages, articles, and categories slightly confusing.  Basically an article is a page with a date, and a category page is a page for other pages and articles in the category.  I didn&amp;rsquo;t like having to create a page for every category so I rewrote it.  Part of Nesta&amp;rsquo;s appeal is the ease with which you can hack it to do what you want.&lt;/p&gt;

&lt;p&gt;The only questionable part of Nesta is its inbuilt page-caching code.  I&amp;rsquo;d prefer to use HTTP caching but, really, that can wait for another day.&lt;/p&gt;

&lt;h2&gt;Design&lt;/h2&gt;

&lt;p&gt;I am inordinately pleased to introduce a highlight colour to the existing palette of greys, black and white: &lt;span style="color:#969db5"&gt;blue&lt;/span&gt;!  Or maybe it&amp;rsquo;s lavender.  Indigo?  Anyway, the particular shade comes from &lt;a href="http://powazek.com"&gt;Derek Powazek&amp;rsquo;s site&lt;/a&gt;.  I toyed with the blue from &lt;a href="http://toolmantim.com"&gt;Tim Lucas&lt;/a&gt; but it was just wrong for here.&lt;/p&gt;

&lt;p&gt;This is exciting because I found Mephisto&amp;rsquo;s theme management system so offputting that I couldn&amp;rsquo;t ever bring myself to change the CSS.  Or indeed the markup.  Now I&amp;rsquo;m writing &lt;a href="http://haml-lang.com/"&gt;HAML&lt;/a&gt;, &lt;a href="http://sass-lang.com/"&gt;SASS&lt;/a&gt;, and &lt;a href="http://daringfireball.net/projects/markdown/"&gt;Markdown&lt;/a&gt; as God intended.&lt;/p&gt;

&lt;h2&gt;HTML5&lt;/h2&gt;

&lt;p&gt;Since I&amp;rsquo;m back in control of my site, I decided to try out HTML5.  Mark Pilgrim&amp;rsquo;s &lt;a href="http://diveintohtml5.org"&gt;Dive Into HTML5&lt;/a&gt; is lucid and informative, and I&amp;rsquo;m enjoying HTML5 a lot.  So this site is coming to you in HTML5.  I haven&amp;rsquo;t yet switched to the new semantic elements but that&amp;rsquo;s next.&lt;/p&gt;

&lt;h2&gt;Feedback&lt;/h2&gt;

&lt;p&gt;The hardest part of all this was setting up the rewrite rules in Apache to redirect my old URLs to the new ones.  I don&amp;rsquo;t do this often enough to remember the pitfalls and I always fail to work it out on my own.  If you do stoop to reading the instructions, &lt;a href="http://articles.sitepoint.com/print/apache-mod_rewrite-examples"&gt;this article&lt;/a&gt; sorted me out.&lt;/p&gt;

&lt;p&gt;Anyway, let me know if I broke anything.&lt;/p&gt;
</content>
    <published>2010-08-13T00:00:00+00:00</published>
    <category term="Sinatra"/>
    <category term="Blog"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-05-20:93690</id>
    <title>Backing up MySQL to Amazon S3</title>
    <updated>2010-05-20T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/backing-up-mysql-to-amazon-s3" rel="alternate"/>
    <content type="html">&lt;p&gt;I recently got round to backing up my applications' databases to S3.  Previously I had a script archiving them each night onto the same server.  This helped if a client deleted something by mistake and wanted to retrieve it, but didn&amp;rsquo;t guard against server failure.&lt;/p&gt;

&lt;p&gt;Fortunately in the four years I&amp;rsquo;ve been with &lt;a href="http://railsmachine.com"&gt;Rails Machine&lt;/a&gt; I&amp;rsquo;ve never had a server failure.&lt;/p&gt;

&lt;p&gt;Having pushed my luck I&amp;rsquo;m now finally backing up the databases to S3.  Better yet, I&amp;rsquo;m incrementally backing up every 15 minutes.  It&amp;rsquo;s not as good as full-blown replication but it&amp;rsquo;s much easier to set up and good enough for now.&lt;/p&gt;

&lt;p&gt;The steps are pretty straightforward.  This note is really an aide-m&#233;moire for the next server I do this on.&lt;/p&gt;

&lt;h2&gt;Enable MySQL&amp;rsquo;s binary logging&lt;/h2&gt;

&lt;p&gt;Edit &lt;code&gt;/etc/my.cnf&lt;/code&gt; and add the line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;log_bin=/var/lib/mysql/binlog/mysql-bin
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Create &lt;code&gt;binlog&lt;/code&gt; directory owned by &lt;code&gt;mysql&lt;/code&gt;&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;$ cd /var/lib/mysql
$ sudo mkdir binlog
$ sudo chown mysql:mysql binlog
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Restart &lt;code&gt;mysqld&lt;/code&gt;&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;$ sudo /sbin/service mysqld restart
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Install &lt;code&gt;myql_s3_backup&lt;/code&gt; gem&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://github.com/macournoyer/mysql_s3_backup"&gt;Marc-Andr&#233; Cournoyer&lt;/a&gt; wrote this gem and it does the job admirably.  I encountered a strange problem though, which I fixed in &lt;a href="http://github.com/airblade/mysql_s3_backup"&gt;my fork&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo gem install airblade-mysql_s3_backup
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Configure the backups (one file per database)&lt;/h2&gt;

&lt;p&gt;Adapt the gem&amp;rsquo;s &lt;a href="http://github.com/airblade/mysql_s3_backup/blob/master/config/sample.yml"&gt;sample config&lt;/a&gt; and stick it somewhere like &lt;code&gt;~/configure&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Set up cron for nightly full backups&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;$ crontab -l
PATH=/opt/ree/bin:$PATH
0 0 * * * fyi "mysql_s3_backup -c=/home/deploy/config/mephisto.yml full"
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Note this uses my &lt;a href="http://github.com/airblade/fyi"&gt;fyi gem&lt;/a&gt; to find out what cron is doing.&lt;/p&gt;

&lt;h2&gt;Set up cron for incremental backups&lt;/h2&gt;

&lt;p&gt;We have to do this as root because of the file permissions on MySQL&amp;rsquo;s binary logs.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo su -
# crontab -l
PATH=/opt/ree/bin:$PATH
5,35 * * * * fyi "mysql_s3_backup -c=/home/deploy/config/mephisto.yml inc"
&lt;/code&gt;&lt;/pre&gt;



</content>
    <published>2010-05-20T00:00:00+00:00</published>
    <category term="Ruby"/>
    <category term="Databases"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-05-18:93657</id>
    <title>Note To Self: How To Build Gems</title>
    <updated>2010-05-18T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/note-to-self-how-to-build-gems" rel="alternate"/>
    <content type="html">&lt;p&gt;This topic has come up quite a bit recently.  I&amp;rsquo;d never really thought about it much before &amp;mdash; I just used &lt;a href="http://github.com/technicalpickles/jeweler"&gt;Jeweler&lt;/a&gt; because that&amp;rsquo;s what &lt;a href="http://github.com/blog/515-gem-building-is-defunct"&gt;GitHub recommended&lt;/a&gt;.  However I had been noticing that Jeweler made what should have been a simple task complicated.  And it decimated the signal to noise ratio of my commits: my &amp;ldquo;real&amp;rdquo; commits were swamped by ones Jeweler made to update the version number and so on.&lt;/p&gt;

&lt;p&gt;So after looking into the matter briefly, here&amp;rsquo;s what I now think.&lt;/p&gt;

&lt;p&gt;The gemspec DSL is nice and clean.  Don&amp;rsquo;t hide it behind something like Jeweler.&lt;/p&gt;

&lt;p&gt;We need to:
* build versioned gems
* build versioned archives (.tar.gz)
* tag the versions in Git / on GitHub
* push the versioned gems to rubygems.org
* (optional) install versioned gems locally&lt;/p&gt;

&lt;p&gt;We can do all this by hand; it&amp;rsquo;s pretty simple.&lt;/p&gt;

&lt;p&gt;We can also save typing with Rake.&lt;/p&gt;

&lt;p&gt;Either DIY:
* &lt;a href="http://github.com/airblade/fyi/blob/master/Rakefile"&gt;Fyi&amp;rsquo;s rakefile&lt;/a&gt; (but not DRY and no archives yet)
* &lt;a href="http://github.com/rtomayko/shotgun/blob/master/Rakefile"&gt;Shotgun&amp;rsquo;s rakefile&lt;/a&gt;
* &lt;a href="http://github.com/defunkt/mustache/blob/master/Rakefile"&gt;Mustache&amp;rsquo;s rakefile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or using a &lt;em&gt;simple&lt;/em&gt; tool like &lt;a href="http://github.com/sr/mg"&gt;minimal gem (mg)&lt;/a&gt;:
* &lt;a href="http://github.com/defunkt/gist/blob/master/Rakefile"&gt;Gist&amp;rsquo;s rakefile&lt;/a&gt;&lt;/p&gt;
</content>
    <published>2010-05-18T00:00:00+00:00</published>
    <category term="Ruby"/>
    <category term="Notes To Self"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-05-11:93517</id>
    <title>Smash Into Vim (Part I)</title>
    <updated>2010-05-11T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/smash-into-vim-part-i" rel="alternate"/>
    <content type="html">&lt;p&gt;My &lt;a href="http://peepcode.com/products/smash-into-vim-i"&gt;Smash Into Vim&lt;/a&gt; PeepCode screencast has just been released.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://peepcode.com/products/smash-into-vim-i"&gt;
&lt;img src='/attachments/peepcode-vim-cover.png' alt="Smash Into Vim" /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s the first of a double bill and after watching it you&amp;rsquo;ll be able to use &lt;a href="http://www.vim.org"&gt;Vim&lt;/a&gt; with confidence.  Even if you&amp;rsquo;re a true blue Textmate fan, sometimes you need to edit config files on your server&amp;hellip;and that&amp;rsquo;s when you&amp;rsquo;ll be glad you watched this screencast!&lt;/p&gt;

&lt;p&gt;Part Two will go into advanced topics.  After watching that you&amp;rsquo;ll be able to make an informed decision about whether to switch to Vim as your primary editor &amp;mdash;&amp;ndash; and be all set to do so.&lt;/p&gt;

&lt;p&gt;Vim looks daunting but we&amp;rsquo;ve thought long and hard about it and distilled its essence.  These 50 minutes are your fastest, best way to get up to speed and &lt;a href="http://peepcode.com/products/smash-into-vim-i"&gt;Smash Into Vim&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Peeping at PeepCode&lt;/h2&gt;

&lt;p&gt;This is the second time I&amp;rsquo;ve collaborated with Geoffrey Grosenbach at PeepCode &amp;mdash; the first was my &lt;a href="http://peepcode.com/products/rails-2-plugin-patterns"&gt;Rails 2 Plugin Patterns&lt;/a&gt; PDF.  Both times were a real pleasure.  If you get a chance to be a PeepCode author, go for it!  It&amp;rsquo;s fun and worthwhile.&lt;/p&gt;

&lt;p&gt;I also think &lt;a href="http://danbenjamin.com/"&gt;Dan Benjamin&lt;/a&gt; did a wonderful job with the narration.  Next time, though, we&amp;rsquo;ll get a British accent on there&amp;hellip;&lt;/p&gt;
</content>
    <published>2010-05-11T00:00:00+00:00</published>
    <category term="Vim"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-03-31:93006</id>
    <title>Publishing dotfiles with private information</title>
    <updated>2010-03-31T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/publishing-dotfiles-with-private-information" rel="alternate"/>
    <content type="html">&lt;p&gt;Like many people I put my &lt;a href="http://github.com/airblade/dotfiles"&gt;dotfiles&lt;/a&gt; on GitHub.  A perennial problem is what to do with files which contain private information.  For example, &lt;code&gt;.gemrc&lt;/code&gt; includes my Gemcutter credentials and &lt;code&gt;.gitconfig&lt;/code&gt; my GitHub credentials.&lt;/p&gt;

&lt;p&gt;Unlike bash scripts, you can&amp;rsquo;t source one configuration file from another.  So either you don&amp;rsquo;t publish these files at all &amp;mdash; or you split them up, publish the public parts, then stitch them back together when you install them.&lt;/p&gt;

&lt;p&gt;This is what I do &lt;a href="http://github.com/airblade/dotfiles/commit/eb88ce028726feb976f49c7ff4042111c5a1f174"&gt;now&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Example: gemrc&lt;/h2&gt;

&lt;p&gt;In my local &lt;code&gt;dotfiles/&lt;/code&gt; directory I have a &lt;code&gt;gemrc_public&lt;/code&gt; and a &lt;code&gt;gemrc_private&lt;/code&gt;.  Git ignores the latter.  When I &lt;code&gt;rake install&lt;/code&gt;, the code creates &lt;code&gt;gemrc&lt;/code&gt;, appends &lt;code&gt;gemrc_public&lt;/code&gt; and &lt;code&gt;gemrc_private&lt;/code&gt; in turn, then symlinks it as &lt;code&gt;~/.gemrc&lt;/code&gt; in the usual way.&lt;/p&gt;

&lt;p&gt;To keep things neat, Git also ignores the generated &lt;code&gt;gemrc&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Finally&lt;/h2&gt;

&lt;p&gt;This is basic stuff, but it&amp;rsquo;s always good to resolve the small niggles.  It keeps coming up (e.g. &lt;a href="http://github.com/ryanb/dotfiles/commit/e1c8f701caab95ddd8d4cfcac87ff3b704b8bf29"&gt;Ryan Bates&lt;/a&gt;, &lt;a href="http://github.com/rtomayko/dotfiles/blob/rtomayko/README#L47-54"&gt;Ryan Tomayko&lt;/a&gt;, and &lt;a href="http://stackoverflow.com/questions/1557183/is-it-possible-to-include-a-file-in-your-gitconfig"&gt;Stack Overflow&lt;/a&gt;) so hopefully this will provide a few people with another option.&lt;/p&gt;
</content>
    <published>2010-03-31T00:00:00+00:00</published>
    <category term="Git"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-03-31:93007</id>
    <title>PaperTrail Improvements</title>
    <updated>2010-03-31T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/papertrail-improvements" rel="alternate"/>
    <content type="html">&lt;p&gt;&lt;a href="http://github.com/airblade/paper_trail"&gt;PaperTrail&lt;/a&gt; is a gem which lets you easily track changes to your ActiveRecord models' data.  Recently I pulled in some good work from &lt;a href="http://github.com/jeremyw"&gt;Jeremy Weiskotten&lt;/a&gt; and Phan Le, while making some improvements of my own.&lt;/p&gt;

&lt;p&gt;Here are the highlights of what changed between 1.4.0 and 1.5.0.&lt;/p&gt;

&lt;h2&gt;Easily store controller-level metadata&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;class ApplicationController &lt; ActionController::Base
  def info_for_paper_trail
    # Default is: {}
    { :ip =&gt; request.remote_ip, :user_agent =&gt; request.user_agent }
  end
end
&lt;/code&gt;&lt;/pre&gt;


&lt;h2&gt;Easily change how the controller figures out who was responsible&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;class ApplicationController &lt; ActionController::Base
  def user_for_paper_trail
    # Default is: current_user rescue nil
    logged_in? ? current_user.name : 'Public user'
  end
end
&lt;/code&gt;&lt;/pre&gt;


&lt;h2&gt;Time-based recovery of models&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; widget = widget.version_at 1.day.ago  # the widget as it was one day ago
&gt;&gt; widget.save                           # reverted
&lt;/code&gt;&lt;/pre&gt;


&lt;h2&gt;Global enable/disable (useful in your tests)&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;# config/environments/test.rb
config.after_initialize do
  PaperTrail.enabled = false
end
&lt;/code&gt;&lt;/pre&gt;


&lt;h2&gt;Invisible changes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Thread-safety&lt;/li&gt;
&lt;li&gt;Cleaner module structure.&lt;/li&gt;
&lt;li&gt;Cleaner tests.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Finally&lt;/h2&gt;

&lt;p&gt;Lots of people use PaperTrail in production and seem pretty happy with it.  You can store any model-level or controller-level information alongside your models' versions, so it&amp;rsquo;s nice and easy to adapt to your specific needs.  And of course it continues to work out of the box with zero configuration &amp;mdash; that&amp;rsquo;s the way I like it.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="http://github.com/airblade/paper_trail/blob/master/README.md"&gt;README&lt;/a&gt; for more details.&lt;/p&gt;
</content>
    <published>2010-03-31T00:00:00+00:00</published>
    <category term="Rails"/>
    <category term="PaperTrail"/>
  </entry>
  <entry>
    <id>tag:blog.airbladesoftware.com,2010-03-04:92544</id>
    <title>Thinning Text in Firefox</title>
    <updated>2010-03-04T00:00:00+00:00</updated>
    <link type="text/html" href="http://airbladesoftware.com/notes/thinning-text-in-firefox" rel="alternate"/>
    <content type="html">&lt;p&gt;If your web design uses light text on a dark background, you&amp;rsquo;ll notice the text looks heavy and blurry.  Instead of sporting a crisp look, your site appears a bit beginner.&lt;/p&gt;

&lt;p&gt;Steve Smith at Ordered List &lt;a href="http://orderedlist.com/our-writing/resources/html-css/thinning-text-in-webkit-safari/" title="Thinning Text in Webkit (Safari)"&gt;solved this problem for Safari&lt;/a&gt;.  However his solution doesn&amp;rsquo;t work in Firefox &amp;mdash; so I came up with this CSS:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@-moz-document url-prefix() {
  body {
    font-weight: 200;
    letter-spacing: 0.3px;
  }
}
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The first line targets Firefox, just like an IE conditional comment.  The &lt;code&gt;font-weight&lt;/code&gt; halves the normal weight of the text, and the &lt;code&gt;letter-spacing&lt;/code&gt; gives the font a little breathing space.  (Note the &lt;code&gt;body&lt;/code&gt; is nested within the &lt;code&gt;@-moz-document&lt;/code&gt; selector.)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.markboulton.co.uk/journal/comments/five-simple-steps-to-better-typography" title="Five simple steps to better typography"&gt;Mark Boulton describes&lt;/a&gt; what&amp;rsquo;s going on:&lt;/p&gt;

&lt;blockquote&gt;

&lt;p&gt;When reversing colour out, e.g. white text on black, make sure you increase the leading and tracking, and decrease your font-weight.  This applies to all widths of Measure.  White text on a black background has a higher contrast to the opposite, so the letter forms need to be wider apart, lighter in weight, and have more space between the lines.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;p&gt;Here are before and after screenshots of Firefox so you can see for yourself:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://airbladesoftware.com/assets/2010/3/4/before.png"&gt;
&lt;img class="left" src='/attachments/before.png' alt="Before" width="220px"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://airbladesoftware.com/assets/2010/3/4/after.png"&gt;
&lt;img class="left" src='/attachments/after.png' alt="After" width="220px"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s not quite as crisp as Safari but it&amp;rsquo;s close, and certainly much better than it was.&lt;/p&gt;

&lt;p&gt;N.B. I&amp;rsquo;ve only done this on my &lt;a href="http://airbladesoftware.com" title="AirBlade Software"&gt;main site&lt;/a&gt;, not here on this blog.  You can see the difference.&lt;/p&gt;

&lt;h2 id='comments'&gt;Comments&lt;/h2&gt;


&lt;div class='comment'&gt;
&lt;p&gt;Looks SO much cleaner :-)&lt;/p&gt;

&lt;cite&gt;Olly &amp;#x2022;  4 March 2010&lt;/cite&gt;
&lt;/div&gt;


&lt;div class='comment'&gt;
&lt;p&gt;This doesn't seem to work for me...does this target a specific version of firefox? Or have to be somewhere in the linked CSS? I'm using FF 3.6.&lt;/p&gt;

&lt;cite&gt;&lt;a href='http://meirish.com'&gt;Matthew&lt;/a&gt; &amp;#x2022; 12 March 2010&lt;/cite&gt;
&lt;/div&gt;


&lt;div class='comment'&gt;
&lt;p&gt;Matthew, this works for me on FF 3.6 -- you can see my CSS &lt;a href="http://airbladesoftware.com/stylesheets/firefox.css"&gt;here&lt;/a&gt;.  I include it into my HTML with a standard stylesheet link.&lt;/p&gt;

&lt;p&gt;Without more information I'm not sure what to suggest.&lt;/p&gt;

&lt;cite&gt;Andy Stewart &amp;#x2022; 12 March 2010&lt;/cite&gt;
&lt;/div&gt;

</content>
    <published>2010-03-04T00:00:00+00:00</published>
    <category term="CSS"/>
    <category term="Typography"/>
  </entry>
</feed>

<!-- page cached: 2010-03-09 15:03:27 -->

