<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brett TerpstraCode page  - Brett Terpstra</title>
	<atom:link href="http://brettterpstra.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettterpstra.com</link>
	<description>Elegant solutions to complex problems.</description>
	<lastBuildDate>Mon, 21 May 2012 12:01:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>LinkSmasher updated, works once again</title>
		<link>http://brettterpstra.com/linksmasher-updated-works-once-again/</link>
		<comments>http://brettterpstra.com/linksmasher-updated-works-once-again/#comments</comments>
		<pubDate>Sat, 19 May 2012 13:00:49 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[dropzone]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=4062</guid>
		<description><![CDATA[<p>If you’re using Dropzone (and why wouldn’t you be?), I updated my LinkSmasher destination recently. You can drop text on it (or just click it to use the clipboard) and it will scan for any links in the text, compile them and create a single link for the group using linkbun.ch. It’s a handy way to share a list of&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/linksmasher-updated-works-once-again/">LinkSmasher updated, works once again</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/05/geeky-cufflinks.jpg?9d7bd4" width="260" height="172" class="alignright shadow" alt="Geeky cufflinks" title="geeky-cufflinks.jpg" />If you’re using <a href="http://aptonic.com/dropzone2/">Dropzone</a> (and why wouldn’t you be?), I updated my <a href="https://github.com/aptonic/dropzone-user-scripts/blob/master/LinkSmasher.dropzone">LinkSmasher</a> destination recently.</p>

<p>You can drop text on it (or just click it to use the clipboard) and it will scan for any links in the text, compile them and create a single link for the group using <a href="http://linkbun.ch">linkbun.ch</a>. It’s a handy way to share a list of urls and allow the recipient to open them all at once (and works really well with <a href="http://brettterpstra.com/tablinks-2-0/">TabLinks</a> for sharing an entire browsing session). If there’s only one URL in the text, it will just shorten it with bit.ly and return the result in your clipboard.</p>

<p>I’d really like to get this working with bit.ly collections, but I haven’t checked lately to see if they’ve added that to the API. If I get around to it, and they did, that will be next up for this little project.</p>

<p>You can find all contributed <a href="https://github.com/aptonic/dropzone-user-scripts">Dropzone Destinations on Github</a> (<a href="https://github.com/aptonic/dropzone-user-scripts/blob/master/LinkSmasher.dropzone">direct link to LinkSmasher</a>). Install Destinations by saving the script to a file in <code>~/Library/Application Support/Dropzone/Destination Scripts</code> with a <code>.dropzone</code> extension, then add a new destination in Dropzone preferences and it will be an option.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/open-urls-dropzone-destination/' rel='bookmark' title='“Open URLs” Dropzone Destination'>“Open URLs” Dropzone Destination</a></li>
<li><a href='http://brettterpstra.com/app-review-dropzone/' rel='bookmark' title='App Review: Dropzone'>App Review: Dropzone</a></li>
<li><a href='http://brettterpstra.com/app-giveaway-dropzone/' rel='bookmark' title='Mac App Giveaway: Dropzone'>Mac App Giveaway: Dropzone</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/linksmasher-updated-works-once-again/">LinkSmasher updated, works once again</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/linksmasher-updated-works-once-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Markdown Editing for Sublime Text 2: humble beginnings</title>
		<link>http://brettterpstra.com/markdown-editing-for-sublime-text-2-humble-beginnings/</link>
		<comments>http://brettterpstra.com/markdown-editing-for-sublime-text-2-humble-beginnings/#comments</comments>
		<pubDate>Thu, 17 May 2012 22:30:37 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[multimarkdown]]></category>
		<category><![CDATA[sublimetext]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=4035</guid>
		<description><![CDATA[<p>I was disappointed to find that there weren’t any good packages available for Sublime Text 2 that added decent Markdown editing features. I figured it was time to learn my way around. I still haven’t dug into Python, so my script-fu in there is weak right now. I got a few things working, though, and this will evolve as I&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/markdown-editing-for-sublime-text-2-humble-beginnings/">Markdown Editing for Sublime Text 2: humble beginnings</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/05/sublime_markdown_editor_shot.jpg?9d7bd4" alt="Sublime Markdown Editor Shot" height="235" width="650" class="aligncenter" style="border: solid 1px #aaa;  display: block; margin-right: auto; margin-left: auto;" ></p>

<p>I was disappointed to find that there weren’t any good packages available for <a href="http://www.sublimetext.com/2">Sublime Text 2</a> that added decent Markdown editing features. I figured it was time to learn my way around. I still haven’t dug into Python, so my script-fu in there is weak right now. I got a few things working, though, and this will evolve as I learn new things. I’ll probably look back at this first version with embarrassment, but I’ll just overwrite it with better stuff as it progresses.</p>

<p>From the README on the <a href="https://github.com/ttscoff/MarkdownEditing">Github repo</a>:</p>

<p>This package will make MarkdownEditor your default theme for Markdown/MultiMarkdown files. Adjust it to your liking or remove the line from the .sublime-settings files</p>

<ul>
<li>Asterisks and underscores are autopaired and will wrap selected text</li>
<li>If you start an empty pair and hit backspace, both elements are deleted</li>
<li>If you start an empty pair and hit space, the right element is deleted</li>
<li>backticks are paired</li>
<li>Left bracket pairing is modified to eliminate the selection and leave the cursor at a point where you can insert a <code>[]</code> or <code>()</code> pair for a link</li>
<li>⌘⌥V will paste the contents of the clipboard as an inline link on selected text</li>
<li>⌘⌥R will paste the contents of the clipboard as a reference link</li>
<li>⌘K inserts a standard inline link, ⌘⇧K inserts an inline image</li>
<li>⌘B and ⌘I are bound to bold and italics (Markdown). <em>If you don’t like losing your default shortcut for “Build”, modify the sublime-keymap file. This only overrides while editing Markdown files.</em></li>
</ul>

<p>There’s a long way to go and I have a lot of Python to learn.</p>

<p>The theme pays some homage to <a href="http://bywordapp.com">Byword</a>, but I make no pretense that it’s anywhere as pretty.</p>

<h3>Installation</h3>

<p>Just download or clone the <a href="https://github.com/ttscoff/MarkdownEditing">MarkdownEditing repo</a> into a MarkdownEditing folder within your <code>~/Library/Application Support/Sublime Text 2/Packages</code> folder. You may have to restart Sublime to get it working, but once it’s installed (if all goes well), you should be able to open a Markdown file and see my custom theme. If you do, then the features listed above should also be available.</p>

<p>Right now, this is designed to be tweaked. I can’t guess what you’re preferred editing environment is like, so I went with mine. I’d love to see any permutations you come up with.</p>

<p>Oh, and by the way, if you’re doing any theming for Sublime Text, here’s a handy little plugin I whipped up to copy the scope of the character after the cursor to the clipboard for easily adding keys to a .tmtheme XML file:</p>

<script src="http://gist.github.com/2721811.js"></script>

<p>Also check out Philip Belesky’s <a href="https://github.com/philipbelesky/Byworded">Byworded themes</a> for TextMate and Sublime Text 2.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/auto-link-text-service-updated/' rel='bookmark' title='Auto-link text service updated'>Auto-link text service updated</a></li>
<li><a href='http://brettterpstra.com/markdown-service-tools-1-3/' rel='bookmark' title='Markdown Service Tools 1.3'>Markdown Service Tools 1.3</a></li>
<li><a href='http://brettterpstra.com/markdown-quicktags-wordpress-plugin/' rel='bookmark' title='Markdown QuickTags: WordPress plugin for Markdown lovers'>Markdown QuickTags: WordPress plugin for Markdown lovers</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/markdown-editing-for-sublime-text-2-humble-beginnings/">Markdown Editing for Sublime Text 2: humble beginnings</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/markdown-editing-for-sublime-text-2-humble-beginnings/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Scatterbrains: git as biographer</title>
		<link>http://brettterpstra.com/scatterbrains-git-as-biographer/</link>
		<comments>http://brettterpstra.com/scatterbrains-git-as-biographer/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:00:57 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[dayone]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3983</guid>
		<description><![CDATA[<p>This is another of my attempts at keeping track of my day in an orderly fashion. It’s a pretty simple idea. Given that most of of what I do is stored in git repositories, my commit logs are my best bet for seeing what I’ve accomplished each day. I just needed to pull them together and bundle them up without&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/scatterbrains-git-as-biographer/">Scatterbrains: git as biographer</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is another of my attempts at keeping track of my day in an orderly fashion. It’s a pretty simple idea. Given that most of of what I do is stored in git repositories, my commit logs are my best bet for seeing what I’ve accomplished each day. I just needed to pull them together and bundle them up without having to think about it. If a lot of your work happens in git repositories and you make frequent commits, this might be of use to you.</p>

<p>This script runs nightly and visits a list of local git repositories to extract a log of any commits for the day. It formats them as Markdown and can log them to Day One or just to a plain text file (single file, appended). There’s an accompanying shell command for easily adding the current directory as a repo to check.</p>

<p>This is what my log looks like in nvALT (with a custom theme):</p>

<div id="attachment_4003" class="wp-caption aligncenter" style="width: 617px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/05/GitLoggerScreenshot.jpg?9d7bd4" alt="GitLogger Screenshot" title="GitLogger" width="607" height="390" class="size-full wp-image-4003" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">GitLogger log in nvALT</p></div>

<p>Git notes are included, as is body text of the commit if it exists. Formatting creates an unordered list, and short hashes for the commits are added at the end of the commit message, just in case you need them.</p>

<p>As usual, if you’re interested in trying it, I’m happy to share…</p>

<p><span id="more-3983"></span></p>

<h3>Automatic installation</h3>

<p>You can use the following command to automatically install the script and have it run at 11:50pm daily:</p>

<pre><code>/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/gist/2633967/ed3f35df05ba12f1ab7176c12ad174d5210b38f1/gitlogger-install.rb)"
</code></pre>

<h3>Manual install</h3>

<ul>
<li>Save the script below (<a href="https://gist.github.com/2632346">gist link</a>) as <code>gitlogger.rb</code> in a script or bin folder on your drive.</li>
<li>Use the variables at the top to set it up for logging to Day One (<code>dayone = true</code>), or enter a path to a text file (<code>textlog = "path/to/text.md"</code>). If you don’t want to use text file logging, just set that option to “false”.</li>
<li>If you’re logging to Day One, see <a href="http://brettterpstra.com/logging-with-day-one-geek-style/">this post</a> for more instructions. This script doesn’t need the <code>dayone</code> CLI tool, but if you’re not using iCloud for storing your journal, you’ll need to modify the paths to point to your journal file.</li>
</ul>

<script src="http://gist.github.com/2632346.js"></script>

<p>The second little script (<a href="https://gist.github.com/2632356">gist link</a>) is a bash function for adding whatever directory I’m working in to the list that the logger uses to find repos for logging. For consistent results in building the repo list, run the <code>glog</code> command from the base directory of the git repository. Set it once and forget it. You can remove repos from logging by editing the file at <code>~/.gitlogger</code>. You can also just create that file by hand: each line is a repo, with the title first, followed by a colon, followed by the path.</p>

<ul>
<li>Add this function to your <code>~/.bash_profile</code> to be able to mark the current directory for logging by typing <code>glog Alias</code>, where “Alias” is the name you want to appear for the repo in your log.</li>
</ul>

<script src="http://gist.github.com/2632356.js"></script>

<p>To automate the script, I suggest using <code>launchd</code> (the OS X version of <code>cron</code>). Use <a href="http://www.peterborgapps.com/lingon/">Lingon</a> or copy the code below into a file called <code>com.yourusername.gitlogger.plist</code> and save it in <code>~/Library/LaunchAgents/</code>. After creating the file, you’ll want to run <code>launchctl load ~/Library/LaunchAgents/com.yourusername.gitlogger.plist</code> to get it started (or log out and back in, but that takes too long). The code as is will set up the logger to run at 11:50pm every night (in your local time). You’ll want to edit the Label and the ProgramArguments values to match your setup.</p>

<pre><code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.brettterpstra.gitlogger&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/bin/ruby&lt;/string&gt;
        &lt;string&gt;/Users/ttscoff/scripts/gitlogger.rb&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;StartCalendarInterval&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;Hour&lt;/key&gt;
        &lt;integer&gt;23&lt;/integer&gt;
        &lt;key&gt;Minute&lt;/key&gt;
        &lt;integer&gt;50&lt;/integer&gt;
    &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>

<p>Maybe this will be of use to <em>somebody</em>. Code contributions and suggestions welcome, just follow the links on the gists above to fork. My personal git workflow works well with this logging statement, but you might want to modify it to log tags only, etc. Let me know what you do with it!</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/automating-taskpaper-to-day-one-logs/' rel='bookmark' title='Automating TaskPaper to Day One logs'>Automating TaskPaper to Day One logs</a></li>
<li><a href='http://brettterpstra.com/logging-with-day-one-geek-style/' rel='bookmark' title='Logging with Day One, geek style'>Logging with Day One, geek style</a></li>
<li><a href='http://brettterpstra.com/a-quick-voodoopad-script-plugin-go-to-today/' rel='bookmark' title='A Quick VoodooPad Script Plugin — Go To Today'>A Quick VoodooPad Script Plugin — Go To Today</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/scatterbrains-git-as-biographer/">Scatterbrains: git as biographer</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/scatterbrains-git-as-biographer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Natural Language Date Service update</title>
		<link>http://brettterpstra.com/natural-language-date-service-update/</link>
		<comments>http://brettterpstra.com/natural-language-date-service-update/#comments</comments>
		<pubDate>Sat, 05 May 2012 21:08:36 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[automator]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[natural language]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3964</guid>
		<description><![CDATA[<p>I made a small update to the natural language date Service that I put together a while back. I wanted it to handle input formats like “+3″ to get a date for 3 days from right now, and to handle adding times to the output if there’s a time-like string in the input. Now you can use, for example: date&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/natural-language-date-service-update/">Natural Language Date Service update</a></p>]]></description>
			<content:encoded><![CDATA[<p>I made a small update to the natural language date Service that I put together <a href="http://brettterpstra.com/os-x-service-for-natural-language-dates/">a while back</a>. I wanted it to handle input formats like “+3″ to get a date for 3 days from right now, and to handle adding times to the output if there’s a time-like string in the input.</p>

<p>Now you can use, for example:</p>

<ul>
<li><code>date +5</code></li>
<li><code>long +21</code></li>
<li><code>short tomorrow 2pm</code></li>
<li><code>date thurs 3:15pm</code></li>
</ul>

<p>Just a couple of tweaks because I found I needed them. The download has been updated (see bottom of post), and we’ll call it version 1.1.</p>

<p><em>p.s.</em> I know I’ve been a little quiet on the blog lately, I’ve had my head buried in too many projects. Marked has some fantastic new features, though, including MarsEdit and VoodooPad support, as well as the ability to accept an entire folder as input and always preview the most recently-edited text file. The latter is perfect for nvALT and Jekyll blogs. Lots of writing to do for other projects, too, so there may be some more dead air. I’m not gone, I’m just making stuff.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/ConvertDate1.1.zip?9d7bd4" title="Download Convert Date - Natural Language Date Service (246)"><img src="http://brettterpstra.com/wp-content/images/serviceicon.jpg?9d7bd4" alt="download image for Convert Date - Natural Language Date Service" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/ConvertDate1.1.zip?9d7bd4" title="Download Convert Date - Natural Language Date Service (246)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/ConvertDate1.1.zip?9d7bd4" title="Download Convert Date - Natural Language Date Service (246)">Convert Date — Natural Language Date Service</a> — A System Service which takes selected text and parses it into a standard date format, using keywords at the beginning to define which format to use. <a href="http://brettterpstra.com/?p=2539">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/os-x-service-for-natural-language-dates/' rel='bookmark' title='OS X Service for natural language dates'>OS X Service for natural language dates</a></li>
<li><a href='http://brettterpstra.com/natural-language-date-conversion-for-textmate/' rel='bookmark' title='Natural language date conversion for TextMate'>Natural language date conversion for TextMate</a></li>
<li><a href='http://brettterpstra.com/natural-language-dates-for-textexpander/' rel='bookmark' title='Natural language dates for TextExpander'>Natural language dates for TextExpander</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/natural-language-date-service-update/">Natural Language Date Service update</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/natural-language-date-service-update/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New text navigation KeyBindings</title>
		<link>http://brettterpstra.com/new-text-navigation-keybindings/</link>
		<comments>http://brettterpstra.com/new-text-navigation-keybindings/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 17:59:12 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[keybindings]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3941</guid>
		<description><![CDATA[<p>I haven’t had much time to write here this week thanks to some day job stress, major additions to Marked, writing for other venues, updating iTextEditors and various other fun. I had a brainstorm that resulted in new KeyBindings this morning, though, and thought it would be a good chance to get a post up before anyone thinks I’ve been&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/new-text-navigation-keybindings/">New text navigation KeyBindings</a></p>]]></description>
			<content:encoded><![CDATA[<p>I haven’t had much time to write here this week thanks to some day job stress, major additions to Marked, writing for other venues, updating iTextEditors and various other fun. I had a brainstorm that resulted in new KeyBindings this morning, though, and thought it would be a good chance to get a post up before anyone thinks I’ve been kidnapped.</p>

<p>In case you’ve missed my past keybinding craziness, you can catch up on the evolution <a href="http://brettterpstra.com/tag/keybindings/">in the tag archive</a>. Basically, OS X has a text system that lets you add custom commands and shortcuts that trigger sequences of the text commands you use every day (e.g. option-arrow word navigation, command-arrow to end of line, etc.).</p>

<p>My shorcut collection is pretty extensive (and beyond even my capability to memorize), but you can pick and choose what’s handy for you and create your own KeyBindings.dict file from it. The latest versions are always <a href="https://github.com/ttscoff/KeyBindings">up on Github</a>.</p>

<p><span id="more-3941"></span></p>

<h3>Paragraph navigation</h3>

<p>The new bindings are primarily for paragraph navigation. One of the features I’ve come to love in several code editing applications is the ability to jump to the first character in the line (after any whitespace). So I added Command-Option-Left/Right Arrow navigation to do just that (and handle last character before trailing whitespace as well). I also added one that jumps to the first alphanumeric character in the line, which is great when working with Markdown lists. The unordered ones, at least, because numbers will stop the movement and it has the same result as jump to first character. This is bound to Control-Command-Option-Left Arrow. You can use them from anywhere in the paragraph, even if you’re at the beginning of a line and intuitively think that left arrow will move backward… with these commands it will always jump to the first character even if it’s in front of the cursor.</p>

<p>Jumping to the last character is cool, but in most of my work any whitespace after that shouldn’t be there. Even when I’m just writing Markdown, I don’t want any extra space triggering a hard line break accidentally. I added one more command to the set for this purpose: Control-Option-Right Arrow jumps to the last character and deletes any space following it. In a similar vein, I updated the Full Outdent command (Control-Shift-Command-Left Arrow) to use the same technique, no longer deleting the first character if the line was already fully outdented.</p>

<p><code>~/Library/KeyBindings/DefaultKeyBinding.dict</code> code for all of the above:</p>

<pre><code>// Move to first Alphanumeric character of line (new)
  "@~^\UF702" = (moveToBeginningOfParagraph:,moveWordRight:, moveWordLeft:);
// Move to first non-whitespace character of line (new)
"@~\UF702" = (moveToBeginningOfParagraph:, insertText:, " ", moveLeft:, selectWord:, moveRight:, setMark:, moveToBeginningOfParagraph:, deleteForward:, swapWithMark:, moveLeft:);
// Select to first character of line with leading space (new)
"@~$\UF702" = (setMark:,moveToBeginningOfParagraph:,selectWord:, moveRight:, selectToMark:);
// Move to last non-whitespace character of paragraph (new)
"~@\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, moveLeft:, setMark:, moveToEndOfParagraph:, deleteBackward:, swapWithMark:);
// Move to end of paragraph and delete trailing whitespace (new)
"^~\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:);
</code></pre>

<h3>Markdown line breaks</h3>

<p>Lastly, this somehow inspired me to add a couple of linebreak commands. In Markdown, adding two spaces at the end of a line causes it to be interpreted as a hard break instead of just concatenating the next line to it in a paragraph. I bound Control-Option-Return to add these spaces to the end of the current line–regardless of cursor position–and begin a new line.</p>

<p>The other line break command (Control-Command-Return) is Markdown again, this time adding two spaces and starting a new paragraph from the cursor position; basically just a way to add a quick hard line break in the middle of a paragraph. This binding conflicts with the Line Focus shortcut in Byword<sup id="fnref:cmdenter"><a href="#fn:cmdenter" rel="footnote">1</a></sup>, by the way, so if I get used to using it I’ll either change the binding in Byword (I never use line focus) or update my own bindings. Feel free to change it to whatever is intuitive to you, keeping in mind that control-enter and shift-enter may already be bound to behaviors in the Cocoa application you’re working in.</p>

<p>Here’s the code for these:</p>

<pre><code>// Add hard break for current line and insert newline below (new)
"^~\U000D" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:, insertText:, "  ", insertNewline:);
// Break line at cursor and add Markdown hard line break (new)
"^@\U000D" = (insertText:, "  ", insertNewline:);
</code></pre>

<h3>Cheatsheet</h3>

<p>In addition to the readme.md file in the repo, I’ve updated the <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">Cheaters</a> cheat sheet for the KeyBindings (because I regularly lose track of the shortcuts for lesser-used bindings). The new sheet is available <a href="https://gist.github.com/2465402">as a gist</a> or you can just right-click and <a href="https://raw.github.com/gist/2465402/7093bbd405dea7c1b424ecab76e92290725fab07/keybindings.html">download the raw file</a>. If you have a default install of Cheaters, you can just overwrite the old <code>keybindings.html</code> file with this one. The new keybindings are marked with “(new)” in green, which is mostly for my own good in locating them quickly<sup id="fnref:search"><a href="#fn:search" rel="footnote">2</a></sup>.</p>

<p>Grab the whole thing from the <a href="https://github.com/ttscoff/KeyBindings">KeyBindings repo on Github</a>.</p>

<p>I know, I’m a little crazy.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:cmdenter">
<p>Command-Enter–my TextMate-style binding for starting a new paragraph from anywhere within a line without breaking it–also conflicts with the full-screen keyboard shortcut. I overrode that one in Byword using System Preferences-&gt;Keyboard-&gt;Applications, but I also include Option-O and Option-Shift-O (Vim-like) in the default file for this reason. <a href="#fnref:cmdenter" rev="footnote">↩</a></p>
</li>

<li id="fn:search">
<p>I really want to add an in-page search to Cheaters. It would greatly improve its usefulness for me if I could just quickly type any part of what I’m looking for and jump to the info. I’ll work on that soon, I think. <a href="#fnref:search" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/keybindings-new-improved-surround-commands/' rel='bookmark' title='KeyBindings: new, improved “surround” commands'>KeyBindings: new, improved “surround” commands</a></li>
<li><a href='http://brettterpstra.com/textmate-keybinding-tip/' rel='bookmark' title='A quick TextMate KeyBindings tip'>A quick TextMate KeyBindings tip</a></li>
<li><a href='http://brettterpstra.com/quick-tip-repeat-cocoa-text-actions-emacsvim-style/' rel='bookmark' title='Quick Tip: repeat Cocoa text actions, Emacs/Vim style'>Quick Tip: repeat Cocoa text actions, Emacs/Vim style</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/new-text-navigation-keybindings/">New text navigation KeyBindings</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/new-text-navigation-keybindings/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Desktop countdown timer with GeekTool and AppleScript</title>
		<link>http://brettterpstra.com/desktop-countdown-timer-with-geektool-and-applescript/</link>
		<comments>http://brettterpstra.com/desktop-countdown-timer-with-geektool-and-applescript/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 22:50:43 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[geeklet]]></category>
		<category><![CDATA[geektool]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3930</guid>
		<description><![CDATA[<p>I just realized today, quite belatedly, that you can control GeekTool on your Mac with AppleScript. I just wanted to play around with it a bit, so I threw together a countdown timer. This could be done much more elegantly, I’m sure; I just wanted to see what I could pull off quickly. The script takes an argument ending in&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/desktop-countdown-timer-with-geektool-and-applescript/">Desktop countdown timer with GeekTool and AppleScript</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/04/DoSomethingInteresting.jpg?9d7bd4" alt="" title="DoSomethingInteresting" width="650" height="209" class="aligncenter size-full wp-image-3931" /></p>

<p>I just realized today, quite belatedly, that you can control <a href="http://itunes.apple.com/us/app/geektool/id456877552?mt=12">GeekTool</a> on your Mac with AppleScript. I just wanted to play around with it a bit, so I threw together a countdown timer. This could be done much more elegantly, I’m sure; I just wanted to see what I could pull off quickly.</p>

<p>The script takes an argument ending in an integer (interpreted as minutes), or a colon-separated hour/minutes argument. The last argument is always the time from <em>now</em>. For example <code>Pick up the kids 1:30</code> would set a timer for an hour and 30 minutes from now. <code>Feed the fish 10</code> would set a timer to go off in 10 minutes.</p>

<p>The script calculates the target time and then runs a loop every second to update a GeekTool shell geeklet with the countdown timer. Yes, you could probably do this more efficiently by making use of the Geeklet’s interval property, but… meh, I don’t have an excuse. I kind of thought of that after writing the script. It’s Sunday, lay off.</p>

<p>If you want to play with it, you need to have GeekTool installed and running. Create a Shell Geeklet by dragging the shell icon to your desktop from the GeekTool window. In the properties for the geeklet, name it “GeekTimer” and leave the timeout and refresh values at zero. Size it so that it’s the full width of your screen, set the paragraph justification to centered, pick a font/color and make it as large as you want.</p>

<p><span id="more-3930"></span></p>

<p>Now, save the AppleScript below as a file called <code>geektooltimer</code> somewhere on your drive. Wherever you put it, you’ll need to adjust any commands that call it to match your own path.</p>

<h3>The AppleScript</h3>

<pre><code>#!/usr/bin/osascript

on padNum(_num)
    if _num &lt; 10 then set _num to "0" &amp; _num
    return _num
end padNum

on run argv
    set message to item 1 of argv

    tell application "GeekTool Helper" to set command of shell geeklet named "GeekTimer" to "echo"

    set {astid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, " "}
    set _task to text items 1 thru ((count of text items of message) - 1) of message as string
    set _min to last item of text items of message
    if (offset of ":" in _min) &gt; 0 then
        set AppleScript's text item delimiters to ":"
        set _min to (item 1 of text items of _min) * 60 + (item 2 of text items of _min)
    end if
    set AppleScript's text item delimiters to astid

    set _date to current date
    set _target to (_date + (_min * 60))
    repeat
        set timeLeft to (_target - (current date))
        set minLeft to round timeLeft / 60 rounding down
        if minLeft &gt; 60 then
            set minLeft to (round minLeft / 60 rounding down) &amp; ":" &amp; padNum(minLeft mod 60)
        else
            set minLeft to padNum(minLeft)
        end if
        set secLeft to padNum(timeLeft mod 60)
        tell application "GeekTool Helper"
            set command of shell geeklet named "GeekTimer" to "echo \"" &amp; _task &amp; " in " &amp; minLeft &amp; ":" &amp; secLeft &amp; "\""

            if (current date) ≥ _target then
                do shell script "/usr/bin/afplay /System/Library/Sounds/Glass.aiff"
                set command of shell geeklet named "GeekTimer" to "echo \"Time to " &amp; _task &amp; "\""
                return "Time to " &amp; _task
            end if
        end tell
        delay 1
    end repeat
end run
</code></pre>

<p>Note that the hashbang at the beginning will let you make it executable and call it without <code>osascript</code>, but I used <code>osascript</code> in the methods below just to be safe.</p>

<p>When the timer is up, it will use <code>afplay</code> to ring a bell and set the final text of the Geeklet to your reminder title. I’m pretty sure <code>afplay</code> is included in a standard install, but if you run into issues just remove that line or substitute your own alert method.</p>

<h3>As a Bash function</h3>

<p>I’m mostly calling this script from the command line. I added a function to <code>~/.bash_profile</code> that looks like this:</p>

<pre><code>## GeekTool Timer
# `gtt Pick up the kids 1:30` sets a timer for 1 hour and 30 minutes
# `gtt Feed the fish 10` will set a timer for 10 minutes
# Running `gtt` with no arguments will clear the running timer and exit
gtt() {
    # if a timer is running, kill it
    pid=$(ps ax | grep -E "osascript .*/geektooltimer" | grep -v grep | awk '{print $1}')
    [[ $pid ]] &amp;&amp; kill $pid
    # Clear any existing text
    /usr/bin/osascript -e 'tell application "GeekTool Helper" to set command of shell geeklet named "GeekTimer" to "echo"'
    # if there are arguments, run the script with them. 
    if [[ $# -gt 0 ]]; then
        /usr/bin/osascript ~/scripts/geektooltimer "$*" 2&gt;&amp;1 &amp;
    fi
}
</code></pre>

<p>Drop that into your <code>~/.bash_profile</code> and run <code>source ~/.bash_profile</code>. Now, in combination with the previous AppleScript, you have a <code>gtt</code> command for setting timers on your desktop from Terminal. Be sure to modify the path in the last command (the one that calls <code>geektooltimer</code>) to match the location of the AppleScript you created.</p>

<p>The function first checks to see if a timer is already running, and if so, kills it. Then it clears any text currently in the “GeekTimer” Geeklet, and then runs the AppleScript and passes all command line arguments as one quoted string. The <code>geektoolreminder</code> script handles parsing out the last number and turns the preceding text into the reminder title. Running just <code>gtt</code> without any arguments will clear the current timer.</p>

<p>There’s not a lot of error checking involved, so incorrect parameters will throw errors on the command line. Feel free to spiff it up.</p>

<h3>As a Launchbar (or Alfred or whatever) action</h3>

<p>You can also call the script from <a href="http://www.obdev.at/products/launchbar/index.html">Launchbar</a> by creating an action like:</p>

<pre><code>on handle_string(message)
    do shell script "/Users/ttscoff/scripts/geektooltimer '" &amp; message &amp; "' &amp;"
end handle_string
</code></pre>

<p>Name the action “GeekTool Reminder” (save it in ~/Library/Application Support/Launchbar/Actions/GeekTool Reminder.scpt). You’ll call it up by popping up Launchbar and typing “GTR” or similar, then pressing space. Enter the text of the reminder and end it with a minute or hour:minute designation. Minor catch: execute it with Option-Return to run it in the background, otherwise Launchbar will freeze until the timer is up.</p>

<p>In Alfred you can probably make a straight shell script that runs in the background automatically, so it would be more in line with the Bash function above than with the Launchbar AppleScript method.</p>

<hr />

<p>What I’m hoping is that this example will get a ball rolling, and someone will see a little bit more exciting potential in it than I came up with on a lazy Sunday. Got a cool AppleScript (or even an idea) for GeekTool? I’d love to hear about it!</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/geeklet-1-minute-average-cpu-load/' rel='bookmark' title='Geeklet: 1-minute average CPU load'>Geeklet: 1-minute average CPU load</a></li>
<li><a href='http://brettterpstra.com/imagemagick-and-geektool-or-nerdtool/' rel='bookmark' title='ImageMagick and GeekTool (or NerdTool)'>ImageMagick and GeekTool (or NerdTool)</a></li>
<li><a href='http://brettterpstra.com/geeklets-weather-and-forecast/' rel='bookmark' title='Geeklets: weather and forecast'>Geeklets: weather and forecast</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/desktop-countdown-timer-with-geektool-and-applescript/">Desktop countdown timer with GeekTool and AppleScript</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/desktop-countdown-timer-with-geektool-and-applescript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Marked 1.4 is go</title>
		<link>http://brettterpstra.com/marked-1-4-available/</link>
		<comments>http://brettterpstra.com/marked-1-4-available/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 19:30:53 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[marked]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3903</guid>
		<description><![CDATA[<p>Marked 1.4 is available on the Mac App Store. I’m announcing this a little prematurely; the press release doesn’t go out until tomorrow morning, but I’m just too excited to hold off. There are quite a few new features, including Scrivener, Leanpub and mmd_merge support, as well as a syntax for including external files with full MultiMarkdown (or custom) processing.&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/marked-1-4-available/">Marked 1.4 is go</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/04/Marked_icon_14.png?9d7bd4" alt="" title="Marked_icon_14" width="220" height="250" class="alignright size-full wp-image-3905" /><a href="http://markedapp.com">Marked</a> 1.4 is available <a href="http://itunes.apple.com/us/app/marked/id448925439?ls=1&amp;mt=12">on the Mac App Store</a>. I’m announcing this a little prematurely; the press release doesn’t go out until tomorrow morning, but I’m just too excited to hold off.</p>

<p>There are quite a few new features, including <a href="http://www.literatureandlatte.com/scrivener.php">Scrivener</a>, <a href="http://leanpub.com/">Leanpub</a> and mmd_merge support, as well as a syntax for including external files with full MultiMarkdown (or custom) processing. This means that you can create a single index file (<a href="http://markedapp.com/help/Just_for_Writers/Multi-File_Documents.html">multiple formats available</a>) and have Marked generate a complete document preview (combining multiple files in the order specified in the index), while watching all of the included files at once.</p>

<p>You can also include external files anywhere in a normal document using simple syntax, and a slight variation of the syntax will include files as code blocks. Related: updated Github style, option to preserve line breaks, support for fenced code blocks and automatic syntax highlighting with language detection. Phew.</p>

<p>There are also print improvements, including the ability to force a page break arbitrarily or to create page breaks before h1 and/or h2 headers. <em>Marked 1.4 can even scroll the preview to the point at which you’re editing in your document</em> (I think I might have buried the lead there).</p>

<p>I updated the internal Markdown reference to include basic MultiMarkdown syntax, turned the help into an HTML-based system which exists outside of the Apple Help System, and updated the Quick Overview intro screen. It’s now awesome. If you’re not a new user and have already disabled that on startup, use <strong>Help-&gt;Quick Overview</strong> to revel in the CSS3 glory. That’s a bit dramatic, but it’s pretty cool.</p>

<p>This version is the first version of Marked that is Lion-only<sup id="fnref:stable"><a href="#fn:stable" rel="footnote">1</a></sup>, and it takes advantage of several new tools in the OS for optimization and stability.</p>

<p>For the full list of new features and fixes, see the <a href="http://markedapp.com/changelog.php#v14">changelog</a>. The <a href="http://markedapp.com/help/">full help system</a> for Marked is available online now, too, if you’d like to explore. Then, of course, go upgrade (and update your reviews, please) or <a href="http://itunes.apple.com/us/app/marked/id448925439?ls=1&amp;mt=12">buy it</a> if you haven’t yet! The <a href="http://markedapp.com">Marked website</a> just got a refresh as well, be sure to check it out.</p>

<p><em>Up next:</em> I plan to fully incorporate <a href="http://fountain.io">Fountain</a> in the next version (hopefully with Final Draft export), as well as the ability to watch an entire folder and display a preview of the most recently-edited file (perfect for nvALT and bookwriting). I’ve already added more text stats for the next version (1.5), including reading time, average syllables, unique word count and more.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:stable">
<p>If you’ve been running Marked on a 32-bit Snow Leopard system and are having issues, a stable version for Snow Leopard ONLY <a href="http://assets.markedapp.com/MarkedSL.zip">is available</a> for free. This is version 1.3.2 of Marked, the last version that was fully compatible with these systems. I’m unable to continue developing for multiple platforms, but will release bugfixes for this version as needed. <a href="#fnref:stable" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/marked-1-3-1-more-multimarkdown-goodies/' rel='bookmark' title='Marked 1.3.1, more MultiMarkdown goodies'>Marked 1.3.1, more MultiMarkdown goodies</a></li>
<li><a href='http://brettterpstra.com/marked-1-2-is-out/' rel='bookmark' title='Marked 1.2 is out!'>Marked 1.2 is out!</a></li>
<li><a href='http://brettterpstra.com/marked-1-4-teaser/' rel='bookmark' title='Marked 1.4 Teaser'>Marked 1.4 Teaser</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/marked-1-4-available/">Marked 1.4 is go</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/marked-1-4-available/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Proximity hacking</title>
		<link>http://brettterpstra.com/proximity-hacking/</link>
		<comments>http://brettterpstra.com/proximity-hacking/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 02:39:00 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[proximity]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3898</guid>
		<description><![CDATA[<p>I’ve been trying for years to get a decent Bluetooth “proximity” setup going so that my iPhone can trigger lighting setups as I enter and exit a room. I think I’ve finally nailed it, though I’m sure there’s plenty more testing to do. The biggest problem I kept running into was that I could get lights to go on when&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/proximity-hacking/">Proximity hacking</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/04/Proximity_icon.png?9d7bd4" alt="Proximity icon" title="Proximity icon" width="128" height="128" class="alignright size-full wp-image-3900" />I’ve been trying for years to get a decent Bluetooth “proximity” setup going so that my iPhone can trigger lighting setups as I enter and exit a room. I think I’ve finally nailed it, though I’m sure there’s plenty more testing to do.</p>

<p>The biggest problem I kept running into was that I could get lights to go on when I entered a room, but while I sat–even when the phone was motionless on my desk–lights would randomly turn off and turn back on. So…</p>

<p>I took the original <a href="https://github.com/revned/proximity">“Proximity”</a> code and updated it for Lion, in the process modifying it to check for valid signal strength instead of just a device name in the active paired list. I also incorporated <a href="https://github.com/dxxb/proximity">dxxb’s patch</a> to check three times before declaring that a device has left the Bluetooth range. Spruced up the pref panel a little and added an RSSI indicator to the drop menu in the menubar.</p>

<p>I’m using this with <a href="http://www.perceptiveautomation.com/indigo/index.html">Indigo</a> and some X10 lamp modules to turn on my office lights when I enter and–more importantly–turn them off when I leave to prevent my wife from complaining about me always leaving my lights on.</p>

<p>This is “use at your own risk.” I don’t think there’s anything going on here that would harm your computer (or even crash it), but I haven’t tested it on any machines other than my Mac Pro.</p>

<p>The code with my mods is <a href="https://github.com/ttscoff/proximity">all up on github</a>, and you can download a Lion-only binary below. I apologize for the menubar icon, the old one had jaggy edges so I wanted to update it. In the process I made an abomination. I’ll remedy that soon. The “Check for updates” button still polls the original author’s site, so that won’t get you far. If I continue to update this beyond new icons, I’ll swap that over to my own site.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Proximity1.6.zip?9d7bd4" title="Download Proximity mod (77)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2012/04/Proximity_icon.png?9d7bd4" alt="download image for Proximity mod" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Proximity1.6.zip?9d7bd4" title="Download Proximity mod (77)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Proximity1.6.zip?9d7bd4" title="Download Proximity mod (77)">Proximity mod</a> — A mod for Proximity to make it more precise and less likely to get a false \“away\” reading. <a href="">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/home-from-punta-cana/' rel='bookmark' title='Home from Punta Cana'>Home from Punta Cana</a></li>
<li><a href='http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/' rel='bookmark' title='Introducing Gather, a Cocoa Markdownifier'>Introducing Gather, a Cocoa Markdownifier</a></li>
<li><a href='http://brettterpstra.com/markdown-quicktags-wordpress-plugin/' rel='bookmark' title='Markdown QuickTags: WordPress plugin for Markdown lovers'>Markdown QuickTags: WordPress plugin for Markdown lovers</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/proximity-hacking/">Proximity hacking</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/proximity-hacking/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sparkup System Service, HTML shorthand everywhere</title>
		<link>http://brettterpstra.com/sparkup-system-service-html-shorthand-everywhere/</link>
		<comments>http://brettterpstra.com/sparkup-system-service-html-shorthand-everywhere/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 17:00:14 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[systemservice]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3846</guid>
		<description><![CDATA[<p>I’m shocked that this hasn’t been done before. I’m sure it has, really, but my searches didn’t turn anything up… Many web devs/designers are familiar with Zen Coding, a little tool available for many text editors which turns shorthand strings into full HTML, among a lot of other nifty tricks. A derivation called Sparkup came out a couple of years&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/sparkup-system-service-html-shorthand-everywhere/">Sparkup System Service, HTML shorthand everywhere</a></p>]]></description>
			<content:encoded><![CDATA[<p>I’m shocked that this hasn’t been done before. I’m <em>sure</em> it has, really, but my searches didn’t turn anything up…</p>

<p>Many web devs/designers are familiar with <a href="https://code.google.com/p/zen-coding/">Zen Coding</a>, a little tool available for many text editors which turns shorthand strings into full HTML, among a lot of other nifty tricks. A derivation called <a href="https://github.com/rstacruz/sparkup">Sparkup</a> came out a <a href="http://brettterpstra.com/quick-link-sparkup-rocks-my-world-a-little/">couple of years back</a>. It added the ability to backtrack up the hierarchy from within the shorthand snippet, which I found to be amazingly useful.</p>

<p>So this all started when I made a keybinding yesterday which turns selected text into a paired HTML tag and allows attributes, so <code>div id="heythere"</code> converts to <code>&lt;div id="heythere"&gt;&lt;/div&gt;</code> when I type Control-&lt; (TextMate style). That’s available on the <a href="http://github.com/ttscoff/KeyBindings">KeyBindings github repo</a>, if you’re interested. I showed the KeyBinding to <a href="http://jdbartlett.com/archive/">Joe Bartlett</a> and the first thing he asked was whether it could do what Zen Coding does. Rabbit hole.</p>

<p>It wouldn’t happen as a keybinding, but it could work as a System Service. No use reinventing the wheel, so I spent a while playing with getting Zen Coding to fit before I remembered Sparkup. Sparkup’s features are pretty minimal compared to the huge toolset that Zen has become, and as such it fits in one file with no dependencies. Perfect for a Service.</p>

<p>I packaged it up and am posting it here. Totally not my work:</p>

<blockquote>
  <p>Sparkup is written by Rico Sta. Cruz and is released under the MIT license.</p>
  
  <p>This project is inspired by Zen Coding of Vadim Makeev. The Zen HTML syntax is forward-compatible with Sparkup (anything that Zen HTML can parse, Sparkup can too).</p>
</blockquote>

<p>Download the System Service version below. To use it, unzip and add the .workflow file to <code>~/Library/Services</code>. Then, open up System Preferences and go to the keyboard shortcuts tab. Select System Services, find it in the panel on the right and click the “Add Shortcut” button that appears when you hover over the right side of its row in the list. Give it a keyboard shortcut you’ll remember. I used Ctrl-, because that’s what it’s bound to in Espresso. Muscle memory.</p>

<p>Now you can type out a shorthand string, select it and hit your shortcut key to watch it blossom into full HTML. Like a code flower. There are quite a few of examples on the <a href="https://github.com/rstacruz/sparkup">Sparkup</a> page, so I’m not going to break down the syntax here. Basically:</p>

<pre><code>div.prettyneat#really&gt;ul&gt;li.item$*2&lt;ol&gt;li*2{ordered list item}+p.last
</code></pre>

<p>becomes:</p>

<pre><code>&lt;div class="prettyneat" id="really"&gt;
    &lt;ul&gt;
        &lt;li class="item1"&gt;&lt;/li&gt;
        &lt;li class="item2"&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ol&gt;
        &lt;li&gt;ordered list item&lt;/li&gt;
        &lt;li&gt;ordered list item&lt;/li&gt;
        &lt;p class="last"&gt;&lt;/p&gt;
    &lt;/ol&gt;
&lt;/div&gt;
</code></pre>

<p>Note that, unlike Zen Coding, you can use “&lt;” to traverse back up the tree. You can also use linebreaks and indentations on longer strings if it helps you keep things straight. Useful when you’re laying out an entire document structure in one string:</p>

<pre><code>div.prettyneat#really&gt;
p.first{content}
+p*2
+ul&gt;
    li.item$*6&gt;a[href=#]
&lt;&lt;ol&gt;
    li*3{ordered list item}
+p.last
</code></pre>

<p>Also, “html:5″ will give you a full HTML5 document with UTF-8 meta, head and body, and additional elements appended with “&gt;” will go inside the body section. Very handy to have when you’re outside of your usual HTML editor.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Sparkup.zip?9d7bd4" title="Download Sparkup System Service (76)"><img src="http://brettterpstra.com/wp-content/images/serviceicon.jpg?9d7bd4" alt="download image for Sparkup System Service" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Sparkup.zip?9d7bd4" title="Download Sparkup System Service (76)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Sparkup.zip?9d7bd4" title="Download Sparkup System Service (76)">Sparkup System Service</a> — Sparkup (https://github.com/rstacruz/sparkup) as an OS X System Service. <a href="http://brettterpstra.com/?p=3846">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/quick-link-sparkup-rocks-my-world-a-little/' rel='bookmark' title='Quick Link: Sparkup rocks my world a little'>Quick Link: Sparkup rocks my world a little</a></li>
<li><a href='http://brettterpstra.com/testing-from-vim/' rel='bookmark' title='Testing from Vim'>Testing from Vim</a></li>
<li><a href='http://brettterpstra.com/quick-tip-mindmanager-to-clean-html/' rel='bookmark' title='Quick Tip: MindManager to (clean) HTML'>Quick Tip: MindManager to (clean) HTML</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/sparkup-system-service-html-shorthand-everywhere/">Sparkup System Service, HTML shorthand everywhere</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/sparkup-system-service-html-shorthand-everywhere/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Experiment: CSV to MMD tables with color coding</title>
		<link>http://brettterpstra.com/experiment-csv-to-mmd-tables-with-color-coding/</link>
		<comments>http://brettterpstra.com/experiment-csv-to-mmd-tables-with-color-coding/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 00:48:33 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[googledocs]]></category>
		<category><![CDATA[multimarkdown]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3824</guid>
		<description><![CDATA[<p>This is a quick experiment with Google Docs, CSVs, MultiMarkdown tables and CSS3 selectors. It’s really hackish, but it’s a start. I wanted to take Google Docs spreadsheet output and turn it into a clean table with color coding and my own styling. Here’s what I’ve done so far (example output here): Downloaded the iOS text editor spreadsheet as a&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/experiment-csv-to-mmd-tables-with-color-coding/">Experiment: CSV to MMD tables with color coding</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is a quick experiment with Google Docs, CSVs, MultiMarkdown tables and CSS3 selectors. It’s really hackish, but it’s a start. I wanted to take Google Docs spreadsheet output and turn it into a clean table with color coding and my own styling. Here’s what I’ve done so far (example output <a href="http://assets.brettterpstra.com/csv2mmd/example.html">here</a>):</p>

<ol>
<li>Downloaded the <a href="http://brettterpstra.com/crowdsourcing-ios-text-editor-comparisons/">iOS text editor spreadsheet</a> as a CSV</li>
<li>Opened in Numbers for minor edits

<ul>
<li>Added a row of <code>:-----:</code> alignment syntax under first (header) row</li>
<li>Removed long text (HTML tables are a pain with wrapping and overflow)</li>
</ul></li>
<li>Exported a new CSV with changes</li>
<li>Regex magic to convert CSV to MMD table (almost automatically, still 5 minutes of hand editing)</li>
<li>Applied basic CSS3 using inline <code>&lt;style&gt;</code> tags in the Markdown

<ul>
<li>turn empty cells dark grey</li>
<li>highlight any cell with content (minus first column) in green</li>
<li>cells with a full-width colspan (tailored to this table, 11 columns) turn lighter grey</li>
</ul></li>
<li>Load it up in <a href="http://markedapp.com">Marked</a> and output the results with embedded style</li>
</ol>

<h3>Pretty pictures</h3>

<p>The cleaned up spreadsheet in Numbers</p>

<p><img src="http://assets.brettterpstra.com/csv2mmd/ioseds.numbers.jpg" alt="The cleaned up spreadsheet in Numbers" /></p>

<p>The converted table in MultiMarkdown</p>

<p><img src="http://assets.brettterpstra.com/csv2mmd/ioseds.md.jpg" alt="The converted table in MultiMarkdown" /> (after using Fletcher’s table cleanup script)</p>

<h3>The CSS:</h3>


<div class="wp_syntax"><div class="code"><pre class="css">table th <span class="br0">&#123;</span>
	<span class="kw1">white-space</span><span class="sy0">:</span><span class="kw2">nowrap</span>
<span class="br0">&#125;</span>
table td<span class="re2">:nth-</span>child<span class="br0">&#40;</span>n<span class="sy0">+</span><span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw1">background</span><span class="sy0">:</span> <span class="kw2">rgb</span><span class="br0">&#40;</span><span class="nu0">156</span><span class="sy0">,</span> <span class="nu0">230</span><span class="sy0">,</span> <span class="nu0">144</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">font-weight</span><span class="sy0">:</span><span class="kw2">bold</span><span class="sy0">;</span>
	<span class="kw1">color</span><span class="sy0">:</span><span class="kw2">rgb</span><span class="br0">&#40;</span><span class="nu0">95</span><span class="sy0">,</span> <span class="nu0">191</span><span class="sy0">,</span> <span class="nu0">68</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">vertical-align</span><span class="sy0">:</span><span class="kw2">middle</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
table td<span class="re2">:empty </span><span class="br0">&#123;</span>
	<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#777</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
table td<span class="br0">&#91;</span>colspan<span class="sy0">=</span><span class="st0">&quot;11&quot;</span><span class="br0">&#93;</span> <span class="br0">&#123;</span>
	<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#aaa</span>!important
<span class="br0">&#125;</span></pre></div></div>


<h3>The hack Ruby CSV→MMD code:</h3>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span class="co1">#!/usr/bin/ruby</span>
&nbsp;
input = STDIN.<span class="me1">read</span>
&nbsp;
<span class="co1"># find quoted cells and replace commas inside quotes with placeholder</span>
input.<span class="kw3">gsub!</span><span class="br0">&#40;</span><span class="sy0">/</span><span class="st0">&quot;([^,].*?)&quot;</span><span class="sy0">/</span>m<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="sy0">|</span>quoted<span class="sy0">|</span>
	quoted.<span class="kw3">gsub</span><span class="br0">&#40;</span><span class="sy0">/</span><span class="br0">&#91;</span>\n\r<span class="br0">&#93;</span><span class="sy0">*/</span>,<span class="st0">''</span><span class="br0">&#41;</span>.<span class="kw3">gsub</span><span class="br0">&#40;</span><span class="sy0">/</span>,<span class="sy0">/</span>,<span class="st0">'zXzX'</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
<span class="co1"># replace remaining commas with table divider (pipe)</span>
input.<span class="kw3">gsub!</span><span class="br0">&#40;</span><span class="sy0">/</span>,<span class="sy0">/</span>,<span class="st0">&quot;| &quot;</span><span class="br0">&#41;</span>
<span class="co1"># remove quotes from quoted cells</span>
input.<span class="kw3">gsub!</span><span class="br0">&#40;</span><span class="sy0">/</span><span class="br0">&#40;</span>\<span class="sy0">|</span> <span class="sy0">|</span>^<span class="br0">&#41;</span><span class="st0">&quot;(.*?)&quot;</span><span class="sy0">/</span>,<span class="st0">&quot;<span class="es0">\\</span>1<span class="es0">\\</span>2&quot;</span><span class="br0">&#41;</span>
<span class="co1"># replace placeholders with commas</span>
input.<span class="kw3">gsub!</span><span class="br0">&#40;</span><span class="sy0">/</span>zXzX<span class="sy0">/</span>,<span class="st0">&quot;,&quot;</span><span class="br0">&#41;</span>
&nbsp;
input.<span class="me1">each</span> <span class="br0">&#123;</span> <span class="sy0">|</span>l<span class="sy0">|</span>
	<span class="kw3">puts</span> <span class="st0">&quot;| #{l.strip} |&quot;</span>
<span class="br0">&#125;</span></pre></div></div>


<p>The script takes input on STDIN, so to use it you pipe the contents of the CSV to it with <code>cat</code>:</p>

<pre><code>cat myfile.csv | ~/scripts/csv2mmd.rb &gt; outputfile.md
</code></pre>

<h3>The result:</h3>

<p>You can view a truncated version of the output <a href="http://assets.brettterpstra.com/csv2mmd/example.html">here</a>. Please note that this comparison chart is not complete and does not include even half the apps in the spreadsheet. It’s just for testing!</p>

<p>You can also see the raw MMD code <a href="http://assets.brettterpstra.com/csv2mmd/example.txt">here</a>. It’s straight from the conversion script but has been run through Fletcher Penney’s table cleanup script to make it readable.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/an-average-morning/' rel='bookmark' title='An average morning'>An average morning</a></li>
<li><a href='http://brettterpstra.com/a-service-for-writing-multimarkdown-footnotes-inline/' rel='bookmark' title='A Service for writing MultiMarkdown footnotes inline'>A Service for writing MultiMarkdown footnotes inline</a></li>
<li><a href='http://brettterpstra.com/quick-tip-clean-up-your-multimarkdown-tables/' rel='bookmark' title='Quick Tip: clean up your MultiMarkdown tables'>Quick Tip: clean up your MultiMarkdown tables</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/experiment-csv-to-mmd-tables-with-color-coding/">Experiment: CSV to MMD tables with color coding</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/experiment-csv-to-mmd-tables-with-color-coding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MultiMarkdown Quick Look with Style</title>
		<link>http://brettterpstra.com/multimarkdown-quick-look-with-style/</link>
		<comments>http://brettterpstra.com/multimarkdown-quick-look-with-style/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 23:43:04 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[multimarkdown]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[quicklook]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3798</guid>
		<description><![CDATA[<p>I added a little hack to Fletcher Penney’s MultiMarkdown Quick Look generator to give it a default style (Github CSS) and allow for customization via a .mdqlstyle.css file located in your home folder. Full details and download available on Github. Screenshot of a Quick Look preview using the Upstanding Citizen style (available on the Github page): I have found that&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/multimarkdown-quick-look-with-style/">MultiMarkdown Quick Look with Style</a></p>]]></description>
			<content:encoded><![CDATA[<p>I added a little hack to Fletcher Penney’s MultiMarkdown Quick Look generator to give it a default style (Github CSS) and allow for customization via a <code>.mdqlstyle.css</code> file located in your home folder. Full details and download available <a href="https://github.com/ttscoff/MMD-QuickLook">on Github</a>.</p>

<p>Screenshot of a Quick Look preview using the Upstanding Citizen style (available on the Github page):</p>

<p><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/MMDQLUpstandingCropped.jpg?9d7bd4" alt="Upstanding Citizen preview" /></p>

<p>I have found that some Markdown tools which come with their own Quick Look generators will always override my custom one, even when they aren’t the file’s owner (e.g. iA Writer). I don’t know how to get around this short of the brute force hack: open the <code>Info.plist</code> inside the qlgenerator file within the offending app’s bundle and delete the entry for <code>net.daringfireball.markdown</code>. That, or just delete the .qlgenerator bundle in the app entirely. That only works until the next time you upgrade, though, and it’s not recommended. If anyone knows a better solution, please shout.</p>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/marked-1-3-1-more-multimarkdown-goodies/' rel='bookmark' title='Marked 1.3.1, more MultiMarkdown goodies'>Marked 1.3.1, more MultiMarkdown goodies</a></li>
<li><a href='http://brettterpstra.com/notational-velocity-and-multimarkdown/' rel='bookmark' title='Notational Velocity and MultiMarkdown'>Notational Velocity and MultiMarkdown</a></li>
<li><a href='http://brettterpstra.com/notational-velocity-alternative-multimarkdown-version/' rel='bookmark' title='Notational Velocity alternative MultiMarkdown version'>Notational Velocity alternative MultiMarkdown version</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/multimarkdown-quick-look-with-style/">MultiMarkdown Quick Look with Style</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/multimarkdown-quick-look-with-style/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Marked 1.4 Teaser</title>
		<link>http://brettterpstra.com/marked-1-4-teaser/</link>
		<comments>http://brettterpstra.com/marked-1-4-teaser/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 00:56:19 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[marked]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3792</guid>
		<description><![CDATA[<p>I’ve been working tirelessly on Marked since 5pm on Friday. I’ve wrapped up fixing almost all of the bugs I’ve created in this development cycle, so I’ve been sprucing things up. I especially needed to revamp the “Welcome” popup for Marked’s upcoming release. I ripped off the design idea1 because I’m too tired to come up with anything cool by&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/marked-1-4-teaser/">Marked 1.4 Teaser</a></p>]]></description>
			<content:encoded><![CDATA[<p>I’ve been working tirelessly on Marked since 5pm on Friday. I’ve wrapped up fixing almost all of the bugs I’ve created in this development cycle, so I’ve been sprucing things up. I especially needed to revamp the “Welcome” popup for Marked’s upcoming release. I ripped off the design idea<sup id="fnref:ripoff"><a href="#fn:ripoff" rel="footnote">1</a></sup> because I’m too tired to come up with anything cool by myself today. Besides, I really dig the way it came out. All CSS3, all the time:</p>


	<!-- Begin Video.js -->
	<video id="example_video_id_1501142344" class="video-js vjs-default-skin" width="600" height="338" poster="/share/video/MarkedTeaser/MarkedTeaserPoster.jpg" controls preload="true" data-setup="{}">
		<source src="/share/video/MarkedTeaser/MarkedTeaser.mp4" type='video/mp4' />
		<source src="/share/video/MarkedTeaser/MarkedTeaser.webm" type='video/webm; codecs="vp8, vorbis"' />
		<source src="/share/video/MarkedTeaser/MarkedTeaser.ogv" type='video/ogg; codecs="theora, vorbis"' />
	</video>
	<!-- End Video.js -->


<p>Out of all the coolness that’s been added in Marked 1.4, the Scrivener/mmd_merge/Leanpub integrations are my favorite. You can now drop a <a href="http://www.literatureandlatte.com/scrivener.php">Scrivener</a> project, an mmd_merge file or a <a href="http://leanpub.com/">Leanpub</a> index file and get a full preview of your document or book. There’s also an all-purpose “include” syntax for both external files and code blocks. Page break syntax for printing, automatic syntax highlighting, an updated Github style, more keyboard commands, more polish. Oh, and I got “Scroll to first edit” working. I’ll keep you posted…</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:ripoff">
<p>Tutorial’s <a href="http://tympanus.net/Tutorials/CSS3PageTransitions/">here</a>. <a href="#fnref:ripoff" rev="footnote">↩</a></p>
</li>

</ol>
</div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/fog-in-the-valley/' rel='bookmark' title='Fog In The Valley'>Fog In The Valley</a></li>
<li><a href='http://brettterpstra.com/marked-1-5-sneak-peek/' rel='bookmark' title='Marked 1.5 Sneak Peek'>Marked 1.5 Sneak Peek</a></li>
<li><a href='http://brettterpstra.com/automating-html5-video-encodes/' rel='bookmark' title='Automating HTML5 video encodes'>Automating HTML5 video encodes</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/marked-1-4-teaser/">Marked 1.4 Teaser</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/marked-1-4-teaser/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dropbox Collection Service fixed</title>
		<link>http://brettterpstra.com/dropbox-collection-service-fixed/</link>
		<comments>http://brettterpstra.com/dropbox-collection-service-fixed/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 14:57:09 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[systemservice]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3785</guid>
		<description><![CDATA[<p>For those who downloaded the original “Create Dropbox Collection” service and experienced errors, a new version has been posted (all download links updated). The issue was that if the files were in the root of the Public folder, it was trying to find a sub-path that wasn’t there. All patched up. Related posts: A Service for sharing Dropbox link collections Dropbox&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/dropbox-collection-service-fixed/">Dropbox Collection Service fixed</a></p>]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/dropboxserviceicon.png?9d7bd4" alt="" title="dropboxserviceicon" width="250" height="227" class="alignright size-full wp-image-3786" />For those who downloaded the original <a href="http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/">“Create Dropbox Collection”</a> service and experienced errors, a new version has been posted (all download links updated). The issue was that if the files were in the root of the Public folder, it was trying to find a sub-path that wasn’t there. All patched up.</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2012/03/dropboxserviceicon.png?9d7bd4" alt="download image for Create Dropbox Collection" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)">Create Dropbox Collection</a> — An OS X System Service for creating an HTML file with lists of links to files in your public Dropbox folder. <a href="http://brettterpstra.com/?p=3769">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/' rel='bookmark' title='A Service for sharing Dropbox link collections'>A Service for sharing Dropbox link collections</a></li>
<li><a href='http://brettterpstra.com/dropbox-and-seamless-mutli-mac-computing/' rel='bookmark' title='Dropbox and seamless mutli-Mac computing?'>Dropbox and seamless mutli-Mac computing?</a></li>
<li><a href='http://brettterpstra.com/system-service-clip-to-day-one/' rel='bookmark' title='System Service: Clip to Day One'>System Service: Clip to Day One</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/dropbox-collection-service-fixed/">Dropbox Collection Service fixed</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/dropbox-collection-service-fixed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Service for sharing Dropbox link collections</title>
		<link>http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/</link>
		<comments>http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 13:56:27 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[systemservice]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3769</guid>
		<description><![CDATA[<p>I wrote this Service a while ago for a friend who kept all of his mockups in Dropbox folders to share. He shared the public links to a group of people who didn’t all use Dropbox, so he’d spend a fair amount of time grabbing links and pasting them into emails. I made this to save him some time, but&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/">A Service for sharing Dropbox link collections</a></p>]]></description>
			<content:encoded><![CDATA[<p>I wrote this Service a while ago for a friend who kept all of his mockups in Dropbox folders to share. He shared the public links to a group of people who didn’t all use Dropbox, so he’d spend a fair amount of time grabbing links and pasting them into emails. I made this to save him some time, but thought it might help a few of you out, too.</p>

<p>It takes a selection of files in your Dropbox public folder and creates a web page with links to each, as well as a button for opening them all in tabs. It doesn’t move them to Dropbox for you, it just makes the links once they’re there and in your public folder (or any subfolder of it). Once it’s run, there’s a dated HTML file in the root public folder that you can send a public link to.</p>

<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/DropboxCollectionEditID.jpg?9d7bd4" alt="Dropbox Collection Edit ID" title="Dropbox Collection Edit ID" width="251" height="173" class="alignright size-full wp-image-3771" />You only need to configure your Dropbox ID, which you can find as a string of numbers in any public url (the long version) that you create. Open up the Service in Automator and edit the very first line. After that, it’s good to go. The style of the page is in a compressed format, not to obscure it, just to keep things optimized. If you want to edit it, either replace the <code>&lt;style&gt;</code> section, or run the chunk of text through a CSS formatter and get the pretty version.</p>

<p>To install, just drop it into <code>~/Library/Services</code> or double click the file and let it install itself. It will show up in your Services menu when you right click after selecting some files. The final output looks like this, and works with as many files as you want to share at once:</p>

<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/DropboxCollectionOutput.jpg?9d7bd4" alt="Create Dropbox Collection output" title="DropboxCollectionOutput" width="650" height="234" class="aligncenter size-full wp-image-3770" /></p>

<p>If your workflow involves sharing collections of files where just sharing a Dropbox folder is inconvenient or not an option, I hope this saves you some time!</p>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/downloads/thumbnails/2012/03/dropboxserviceicon.png?9d7bd4" alt="download image for Create Dropbox Collection" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/CreateDropboxCollection1.1.zip?9d7bd4" title="Download Create Dropbox Collection (329)">Create Dropbox Collection</a> — An OS X System Service for creating an HTML file with lists of links to files in your public Dropbox folder. <a href="http://brettterpstra.com/?p=3769">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/dropbox-collection-service-fixed/' rel='bookmark' title='Dropbox Collection Service fixed'>Dropbox Collection Service fixed</a></li>
<li><a href='http://brettterpstra.com/dropbox-and-seamless-mutli-mac-computing/' rel='bookmark' title='Dropbox and seamless mutli-Mac computing?'>Dropbox and seamless mutli-Mac computing?</a></li>
<li><a href='http://brettterpstra.com/quick-tip-running-nvalt-after-a-notational-velocity-update/' rel='bookmark' title='Quick tip: running nvALT after a Notational Velocity update'>Quick tip: running nvALT after a Notational Velocity update</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/">A Service for sharing Dropbox link collections</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/a-service-for-sharing-dropbox-link-collections/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Cheaters: customizable cheat sheet system</title>
		<link>http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/</link>
		<comments>http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 20:10:51 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://brettterpstra.com/?p=3747</guid>
		<description><![CDATA[<p>First and foremost, this is a total ripoff of an idea by Gabe Weatherhead over at Macdrifter. I just expanded on the idea a little bit. Cheaters is a collection of HTML-based cheat sheets meant for display in an Automator-based popup browser which can float on your screen while you work in other apps. Most of the time I create&#8230;</p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">Cheaters: customizable cheat sheet system</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheat-Sheets-Header.jpg?9d7bd4" alt="Cheat Sheets Header" title="Cheat Sheets" width="650" height="157" class="alignnone size-full wp-image-3749" /></p>

<p>First and foremost, this is a total ripoff of an idea by Gabe Weatherhead <a href="http://www.macdrifter.com/2012/02/markdown-cheat-sheets-and-marked/">over at Macdrifter</a>. I just expanded on the idea a little bit.</p>

<p>Cheaters is a collection of HTML-based cheat sheets meant for display in an Automator-based popup browser which can float on your screen while you work in other apps. Most of the time I create <a href="http://smilesoftware.com/TextExpander/">TextExpander</a> snippets for commonly-forgotten formats, but having an overall reference can be handy. I’ve included a collection of hastily made sheets as examples for you to create your own. Sheets are easy to create with minimal markup and are, for the most part, automatically styled and made to fit in with Cheaters overall aesthetic.</p>

<div id="attachment_3754" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheat-Sheets-wide.jpg?9d7bd4" alt="Cheat Sheets wide" title="Cheat Sheets wide" width="400" height="471" class="size-full wp-image-3754" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Cheaters full-width view</p></div>

<p><span id="more-3747"></span></p>

<h3>Using Cheaters</h3>

<p>The most useful way to use Cheaters is with an Automator Application.</p>

<div id="attachment_3755" class="wp-caption aligncenter" style="width: 540px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheaters-Automator.jpg?9d7bd4" alt="Cheaters Automator" title="Cheaters Automator" width="530" height="444" class="size-full wp-image-3755" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Cheaters Automator Application setup</p></div>

<ol>
<li><a href="#download">Download the Cheaters.zip</a> file below and put it anywhere on your computer (I keep mine in Dropbox so that my cheat sheets are available on other machines). </li>
<li>Open Automator in your Applications folder. </li>
<li>Create a new project with the type “Application.” You can also use a Workflow, which can be launched easily from the command line, but I’m using an Application for now because it’s easiest to launch with a hotkey program.</li>
<li>Drag two actions from the library on the left into the blank area on the right: <strong>Get Specified URLs</strong> and <strong>Website Popup</strong>, in that order. You can find them quickly by selecting “Library” on the left and using the filter to locate them.</li>
<li>Double click the default URL in the <strong>Get Specified URLs</strong> action and set it to the file path to your Cheaters folder. This will be in the format <code>file:///Users/yourusername/path/to/Cheaters/index.html</code>.</li>
<li>Set a size in the <strong>Website Popup</strong> action. I’m using a custom size of 700x800, which works well on my setup with two large monitors. The popup is resizable after opening, so it’s not critical. Cheaters has a responsive design that will mutate into a single column with a dropdown menu at smaller sizes, so if you have a small screen, use the iPhone preset.</li>
<li>Save the application to your /Applications folder (or ~/Applications).</li>
</ol>

<p>You can add a hotkey or other launch method using Launchbar, Keyboard Maestro, Alfred, Apptivator, etc. Lots of choices. When the application launches, it automatically becomes a floating HUD, and you can dismiss it by focusing it and using Escape or ⌘Q.</p>

<p>You can also use Cheaters in a web browser, just put it on your disk and point your browser to the <code>file:///...</code> location.</p>

<h3>Customizing</h3>

<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheat-Sheets-narrow-menu.jpg?9d7bd4" alt="Cheat Sheets narrow menu" title="Cheat Sheets narrow menu" width="350" height="289" class="size-full alignright wp-image-3751" />If you know a little HTML, adding and editing sheets is easy. Take a look at the existing documents in the included <strong>cheatsheets</strong> folder. The markup varies but a lot of cases are already handled by the CSS. I stole most of the included cheat sheets from existing web sources (credits at the bottom of each). Some of them I just ripped the HTML out of directly, some I <a href="http://markdownrules.com/">converted</a> <a href="http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/">to Markdown</a> and then to HTML to get cleaner output. The HTML in the cheat sheets does not need a head, body or containing div, just the markup that goes inside the container in the index.html file.</p>

<h4>The menu</h4>

<p>The index file for Cheaters loads each cheat sheet dynamically into its own markup (using jQuery). To add a new sheet to the menu (or remove/rearrange existing sheets), just edit the unordered list in the #nav ul. The order of the list is the order of the menu items, and the first one in the list is loaded by default. If you only ever want one cheat sheet, just make it the only one in the list. New cheat sheets should be stored as HTML files in the <strong>cheatsheets</strong> folder, and referenced from the links in the #nav list with the relative path <code>cheatsheets/filename.html</code>.</p>

<h4>The look</h4>

<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheat-Sheets-narrow-high-contrast.jpg?9d7bd4" alt="Cheat Sheets narrow high-contrast" title="Cheat Sheets narrow high-contrast" width="214" height="272" class="size-full alignright wp-image-3750" />If you run into markup that isn’t handled by the CSS, just wrap it in a div with a unique ID and add specific styles in the main CSS file to override or augment default styles. You can, of course, completely replace that stylesheet if you want an entirely different look. I promise not to be offended.</p>

<p>There’s also a contrast icon in the upper right, which you can use to flip between light-on-dark and dark-on-light. You can make this change permanent by editing the body class in index.html. Adding a class of “inverted” will set it to be light-on-dark by default; without that class it’s dark-on-light automatically.</p>

<h4>Using PDFs</h4>

<div id="attachment_3753" class="wp-caption aligncenter" style="width: 409px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><img src="http://cdn2.brettterpstra.com/wp-content/uploads/2012/03/Cheat-Sheets-Wide-Image.jpg?9d7bd4" alt="Cheat Sheets with image" title="Cheat Sheets Wide Image" width="399" height="431" class="size-full wp-image-3753" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Cheat Sheets with image</p></div>

<p>If you find a PDF cheat sheet that’s ideal for this type of display, you’ll need to convert it to an image (gif, jpg or png) first. Make it large, between 800px and 1024px wide. Cheaters will automatically scale it to your browser width, and when your browser width gets small enough that the image would be unreadable, it shows it full size and lets you scroll around within the viewport. See the CSS3 cheat sheet markup for an example of using an image; it’s just an image tag in an html file. Easy as pie.</p>

<p>If you create some great cheat sheets, let me know!</p>

<h3>Download</h3>

<div class="download_desc"><p class="download-icon"><a href="http://brettterpstra.com/downloads/Cheaters.zip?9d7bd4" title="Download Cheaters (775)"><img src="http://brettterpstra.com/wp-content/plugins/download-monitor/page-addon/thumbnail.gif?9d7bd4" alt="download image for Cheaters" width="64" /></a><br /><a href="http://brettterpstra.com/downloads/Cheaters.zip?9d7bd4" title="Download Cheaters (775)" class="download-button">Download</a></p><p class="desc"><a href="http://brettterpstra.com/downloads/Cheaters.zip?9d7bd4" title="Download Cheaters (775)">Cheaters</a> — Customizable cheat sheet system <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">More Info</a></p></div>
<p>Related posts:<ol>
<li><a href='http://brettterpstra.com/a-cheat-sheet-for-app-store-pricing/' rel='bookmark' title='A cheat sheet for App Store pricing'>A cheat sheet for App Store pricing</a></li>
<li><a href='http://brettterpstra.com/a-little-keybinding-sanity/' rel='bookmark' title='A little KeyBinding sanity'>A little KeyBinding sanity</a></li>
<li><a href='http://brettterpstra.com/promptdown-for-ios-mobile-markdown-teleprompter/' rel='bookmark' title='PromptDown for iOS: Mobile Markdown Teleprompter'>PromptDown for iOS: Mobile Markdown Teleprompter</a></li>
</ol></p><p>Originally posted on <a href="http://brettterpstra.com" title="BrettTerpstra.com">BrettTerpstra.com</a> at <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">Cheaters: customizable cheat sheet system</a></p>]]></content:encoded>
			<wfw:commentRss>http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 39/177 queries in 0.278 seconds using xcache
Object Caching 4391/4560 objects using xcache
Content Delivery Network via cdn2.brettterpstra.com

Served from: brettterpstra.com @ 2012-05-21 19:00:40 -->
