<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>mitchchn.me</title>
        <description>Coffee, Code, Language and Giant Spiders - By Mitchell Cohen</description>      
        <link>http://mitchchn.me</link>
        <atom:link href="http://mitchchn.me/feed.xml" rel="self" type="application/rss+xml" />
        
            <item>
                <title>How Apple Can Solve Freemium Creep: Make a Freemium Ghetto</title>
                <description>&lt;p&gt;Count the problems in this picture:&lt;/p&gt;

&lt;div class=&quot;banner&quot;&gt;
&lt;a href=&quot;/public/img/problem_free.png&quot;&gt;&lt;img src=&quot;/public/img/problem_free.png&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;I count eight, not including my crying-out-for-a-lightning-cable battery life and the one-bar reception on Rogers.&lt;sup id=&quot;fnref:rogers&quot;&gt;&lt;a href=&quot;#fn:rogers&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Eight of the top ten “Free” iPhone apps aren’t free at all. They contain in-app purchases. Apple even spells it out for us—in size 8-pt. Helvetica Neue, in text a shade darker than the white background, underneath big blue buttons that scream &lt;span style=&quot;color:blue&quot;&gt;FREE&lt;/span&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;These warnings, new as of iOS 7.1.1, are a welcome addition to the platform. (It only took an FTC investigation, $32-million in refunds, and a media backlash.) But they don’t address the problem of freemium creep on the App Store.&lt;/p&gt;

&lt;p&gt;Apps with in-app purchases are still too easy to mistake for their free counterparts. They’re still cluttering up parts of the storefront where they don’t belong. And they’re more popular than ever, crowding out free and paid apps alike. None of those problems can be fixed with disclaimers.&lt;/p&gt;

&lt;p&gt;It’s time for Apple to put its foot down and tell non-free apps where they belong. It’s time they were sent to the Freemium Ghetto.&lt;/p&gt;

&lt;h2 id=&quot;solution-1-merge-freemium-and-paid-apps&quot;&gt;Solution 1: Merge Freemium and Paid Apps&lt;/h2&gt;

&lt;p&gt;I don’t hate the freemium business model. Some companies wield in-app purchases &lt;a href=&quot;http://www.escapistmagazine.com/articles/view/video-games/editorials/reviews/10956-Dungeon-Keeper-Mobile-Review-Wallet-Reaper&quot;&gt;for evil&lt;/a&gt;, but plenty of small developers have found &lt;a href=&quot;https://www.fiftythree.com/paper&quot;&gt;well-deserved success&lt;/a&gt; by releasing their product for free with paid upgrades.&lt;/p&gt;

&lt;p&gt;Freemium apps can be hugely effective, and that’s all the more reason why Apple needs to move them somewhere else. They’re are just too good at what they do. Their cost of entry—zilch—is just too compelling. They bulldoze everything in their path.&lt;/p&gt;

&lt;p&gt;But where to put them? One possibility is to group freemium apps with paid apps. That way, consumers could browse the “Free” listings without having to worry about spending a cent, and all monetized apps would compete transparently and on the same level.&lt;/p&gt;

&lt;p&gt;Here is what the App Store might look like if freemium and paid apps shared a single “Paid” list:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/public/img/problem_paid.png&quot;&gt;&lt;img src=&quot;/public/img/problem_paid.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This setup might come across as more respectful of App Store browsers. But it’s got its problems. A merged list would be a slap in the face to developers of traditional paid apps. Only a handful would ever make it near the top ten when pitted against freemium competition.&lt;/p&gt;

&lt;p&gt;Freemium developers wouldn’t be so thrilled with this arrangement either. They’d have to put up with the stigma of being called “Paid”. Nor would consumers be any less confused by the melange of payment options than they are now. Merging lists is a bad deal for everyone.&lt;/p&gt;

&lt;h2 id=&quot;solution-2-the-freemium-ghetto&quot;&gt;Solution 2: The Freemium Ghetto&lt;/h2&gt;

&lt;p&gt;A better solution requires a third type of app and a third category on the “Top Charts” screen. (The existing “Top Grossing” list would have to hit the chopping board, but that metric’s almost entirely meaningless for consumers anyway.) A new list would rise up—one where freemium apps could thrive: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Freemium Ghetto&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;text-center banner&quot;&gt;
&lt;img src=&quot;/public/img/freemium_ghetto.png&quot; class=&quot;small-image&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;All apps now belong to one of three types: &lt;strong&gt;Free&lt;/strong&gt;, &lt;strong&gt;Paid&lt;/strong&gt;, and &lt;strong&gt;Demo&lt;/strong&gt; (freemium).&lt;sup id=&quot;fnref:demo&quot;&gt;&lt;a href=&quot;#fn:demo&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;This simple reorganization would improve the app-shopping experience immensely. Thanks to the Freemium Ghetto, “Free” would become a safe word on the App Store. There’d be no more need to question if that game you just impulse-downloaded wanted to sucker you in with hidden costs. Apps would wear their intentions on their sleeves. The App Store would feel less like the casino it resembles today.&lt;/p&gt;

&lt;p&gt;More honest labeling would give paid apps more of a chance to succeed. Given the choice between an app labeled “FREE” and one that costs a buck, it’s obvious what most consumers will pick. But if the decision is between a demo of one app and a full version of another, the choice is more even-handed.&lt;/p&gt;

&lt;p&gt;The Freemium Ghetto would be good news for freemium creators too—at least in the long run. They would avoid the kind of PR blow-ups that emerge when children (or childish adults) waste hundreds of dollars on an app or game they believed to be free. Parents would find the three-way distinction easier to understand than the existing choice between Paid, Free and “Free.”&lt;/p&gt;

&lt;p&gt;By reserving the “FREE” label for those apps that truly deserve it, Apple would build consumer trust and confidence in its platform. That’s something all developers should want to see happen.&lt;/p&gt;

&lt;p&gt;But the best part for developers? An exclusive category for apps with IAP would do wonders for exposure. No longer would freemium apps have to compete with free apps for positions in the rankings. In the Freemium Ghetto, the majority of them would be more visible than they are now.&lt;/p&gt;

&lt;p&gt;These are all reasons why Apple should build the Freemium Ghetto. It might sound like kind of scary change that would make certain big name game publishers angry, but it’d be worth it.&lt;/p&gt;

&lt;p&gt;Do it for your customers, Apple. Do it for your developer community. Do it the future of the App Store.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Agree? Not so much? Tell me: &lt;a href=&quot;http://twitter.com/mitchchn&quot;&gt;@mitchchn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:rogers&quot;&gt;
      &lt;p&gt;For Americans: Pretend AT&amp;amp;T and Fox Broadcasting had a Canadian baby out of wedlock. That’s Rogers. One part Big Telecom, one part Big Media. &lt;a href=&quot;#fnref:rogers&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:demo&quot;&gt;
      &lt;p&gt;I’m fond of the word “Demo” because of its connotations in the gaming world. Perhaps Apple could come up with a better moniker. It doesn’t matter. What matters is that there’s a clear separation between the three payment models on the App Store. &lt;a href=&quot;#fnref:demo&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Mon, 19 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/the-freemium-ghetto/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/the-freemium-ghetto/</guid>
            </item>
        
            <item>
                <title>(And eight hundred more)</title>
                <description>&lt;p&gt;On Wednesday night I went to bed pretty pleased with myself. My article abut the &lt;a href=&quot;/2014/os-x-terminal&quot;&gt;OS X command line&lt;/a&gt; had captured the attention of a few hundred visitors that evening. I’d even received a bit of feedback. Not bad for a week-old personal blog, eh?&lt;/p&gt;

&lt;p&gt;I was in for one hell of a surprise. When I woke up on Thursday morning—my 25th birthday—the number of pageviews had reached 30,000. By Friday evening, just over 100,000 people had seen my article. And it feels like a good tenth of them have responded in some way: comments, compliments, and criticism. Gratitude. Typo corrections. Sage advice. Birthday wishes.&lt;/p&gt;

&lt;p&gt;To someone entirely unused to online notoriety, it feels as though a very geeky flash mob materialized in my apartment one evening, stayed for dinner, then went home and reviewed my cooking on Yelp. I am a little dazed.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;With any luck, at least a few of those visitors will invite themselves back. The Terminal post was meant for a more technical audience than my main series, &lt;a href=&quot;/2014/coding-for-journalists-p0&quot;&gt;Coding for Journalists&lt;/a&gt;. But it won’t be the last of its kind. And one of my goals for this place is to explore some of the more basic topics in hackerdom in a way that’s compelling for people of different backgrounds and skill levels. I hope I’m succeeding.&lt;sup id=&quot;fnref:html&quot;&gt;&lt;a href=&quot;#fn:html&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;h2 id=&quot;you-forgot-x&quot;&gt;“You forgot X!”&lt;/h2&gt;

&lt;p&gt;Of course, there are far more than just eight utilities every Terminal user should know.&lt;/p&gt;

&lt;p&gt;In the past couple days, dozens of people have shared with me their own favourite Terminal one-liners and scripts. I’ve learned new tricks about the tools I covered in my article, and discovered others I’d rarely or never touched. In fact, the best thing about the reaction to my article wasn’t the feedback directed at the post, my blog, or myself; it was the discussion that spawned all around the Mac-o-sphere about the command line and how to make the most of it.&lt;/p&gt;

&lt;p&gt;I’m going to highlight a few of the more interesting utilities I missed in this post. It’s also worth taking a look at the comment section on &lt;a href=&quot;https://news.ycombinator.com/item?id=7747982&quot;&gt;Hacker News&lt;/a&gt;. There are troves of good information out there from people much more knowledgeable than I will ever be.&lt;/p&gt;

&lt;p&gt;And now, in no particular order, the shortlist:&lt;/p&gt;

&lt;h3 id=&quot;open&quot;&gt;open&lt;/h3&gt;

&lt;p&gt;I covered &lt;code&gt;open&lt;/code&gt; previously, but it deserves an encore for a feature several people brought to my attention. Typing &lt;code&gt;open -a Safari&lt;/code&gt; will launch Safari—no matter where Safari is located on the system. The same shortcut works for any Mac application. There’s no need to have the full path.&lt;/p&gt;

&lt;p&gt;This black magic is made possible thanks to &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/Carbon/reference/LaunchServicesReference/Reference/reference.html&quot;&gt;Launch Services&lt;/a&gt;, the same system that associates filetypes with their applications in Finder. Thank you to all the users on reddit and Twitter who introduced me to this trick.&lt;/p&gt;

&lt;h3 id=&quot;textutil&quot;&gt;textutil&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;textutil&lt;/code&gt; uses Cocoa’s text engine to manipulate documents and convert them between various formats, including &lt;strong&gt;.doc&lt;/strong&gt;, &lt;strong&gt;.txt&lt;/strong&gt;, &lt;strong&gt;.html&lt;/strong&gt; and &lt;strong&gt;.rtf&lt;/strong&gt;. For example, here’s how to make an HTML file out of a simple Word document:&lt;sup id=&quot;fnref:cleaner&quot;&gt;&lt;a href=&quot;#fn:cleaner&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ textutil -convert html article.doc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another interesting feature of &lt;code&gt;textutil&lt;/code&gt; is its ability to concatenate (join together) multiple files into one long document. This command will join three Word documents together into one .rtf:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ textutil -cat rtf article1.doc article2.doc article3.doc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thanks to &lt;strong&gt;cstross&lt;/strong&gt; from Hacker News for teaching me about &lt;code&gt;textutil&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;sips&quot;&gt;sips&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;sips&lt;/code&gt; is an image processing tool and a native alternative to ImageMagick. Because it’s built on top of Apple’s &lt;a href=&quot;http://en.wikipedia.org/wiki/Core_Image&quot;&gt;Core Image&lt;/a&gt;, the capabilities of &lt;code&gt;sips&lt;/code&gt; go quite deep into areas such as colour profiles. But it’s also a nice tool for quick image manipulations, like converting, resizing, cropping, and rotating.&lt;/p&gt;

&lt;p&gt;This script will convert a folder filled with jpegs to pngs:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ for file in *.jpeg; do sips -s format png $file --out $file.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Dr. Drang has a great &lt;a href=&quot;http://www.leancrew.com/all-this/2014/05/a-little-sips/&quot;&gt;writeup of his sips&lt;/a&gt; and how he uses it in workflows for his clients.&lt;/p&gt;

&lt;h3 id=&quot;ssh-add&quot;&gt;ssh-add&lt;/h3&gt;

&lt;p&gt;If you frequently use &lt;code&gt;ssh&lt;/code&gt; to access a secure server, such as Amazon’s EC2, you should know about &lt;code&gt;ssh-add&lt;/code&gt;. This command lets you save your private key file to the OS X &lt;a href=&quot;http://en.wikipedia.org/wiki/Keychain_\(Apple\)&quot;&gt;Keychain&lt;/a&gt;. Set it up once, and you can use the bare &lt;code&gt;ssh&lt;/code&gt; command without manually including the private key file or messing around with the contents of &lt;code&gt;~/.ssh/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Before:&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ssh -i keyfile.pem [server]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;After:&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ssh-add -k keyfile.pem

$ ssh [server]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thanks to a Hacker News user, &lt;strong&gt;pling&lt;/strong&gt;, for reminding me about this one.&lt;/p&gt;

&lt;h3 id=&quot;man&quot;&gt;man&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; command to bring up help manuals isn’t exclusive to OS X, nor is there much that’s new to say about it. But Twitter user &lt;a href=&quot;http://twitter.com/peternlewis&quot;&gt;@peternlewis&lt;/a&gt; reminded me of a &lt;strong&gt;Terminal.app&lt;/strong&gt; feature that is worth repeating. If you begin typing the name of a command into the &lt;strong&gt;Help&lt;/strong&gt; menu, Terminal will automatically bring up the relevant &lt;code&gt;man&lt;/code&gt; pages.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/man.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There are still more utilities I haven’t had a chance to cover in these two posts—and that’s not including the dozens of essential UNIX commands that are beyond the scope of a Mac-only list. But I hope that you’ve found at least some of these choices helpful for your own workflow. If you have your own favourites that you’d like to share, give me a shout on &lt;a href=&quot;http://mitchchn.me/&quot;&gt;Twitter&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:html&quot;&gt;
      &lt;p&gt;Besides: *you* don’t need to learn basic web development—but surely you have an intelligent, non-hacker friend who does. Or maybe you’d just like to scrutinize my code, recommendations, and writing style for mistakes. Both types are welcome here. &lt;a href=&quot;#fnref:html&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:cleaner&quot;&gt;
      &lt;p&gt;A Hacker News poster suggested that the HTML output of &lt;code&gt;textutil&lt;/code&gt; is cleaner than what you’d get from TextEdit and MS Word. That’s good to know if true. As I’ve written before, it’s always better to write HTML by hand. &lt;a href=&quot;#fnref:cleaner&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Sat, 17 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/and-eight-hundred-more/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/and-eight-hundred-more/</guid>
            </item>
        
            <item>
                <title>Eight Terminal Utilities Every OS X Command Line User Should Know</title>
                <description>&lt;p&gt;The OS X Terminal opens up a world of powerful UNIX utilities and scripts. If you’re migrating from Linux, you’ll find many familiar commands work the way you expect. But power users often aren’t aware that OS X comes with a number of its own text-based utilities not found on any other operating system. Learning about these Mac-only programs can make you more productive on the command line and help you bridge the gap between UNIX and your Mac.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Thanks to reader feedback, I’ve written about a few more commands in a follow-up post: &lt;a href=&quot;http://www.mitchchn.me/2014/and-eight-hundred-more/&quot;&gt;(And eight hundred more)&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;open&quot;&gt;1. &lt;strong&gt;open&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;open&lt;/code&gt; opens files, directories and applications. Exciting, right? But it really does come in handy as a &lt;strong&gt;command-line double-click.&lt;/strong&gt; For instance, typing:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ open /Applications/Safari.app/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…will launch Safari as if you had double-clicked its icon in the Finder.&lt;sup id=&quot;fnref:bundles&quot;&gt;&lt;a href=&quot;#fn:bundles&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;If you point &lt;code&gt;open&lt;/code&gt; at a file instead, it will try to load the file with its associated GUI application. &lt;code&gt;open screenshot.png&lt;/code&gt; on an image will open that image in Preview. You can set the &lt;code&gt;-a&lt;/code&gt; flag to choose the app yourself, or &lt;code&gt;-e&lt;/code&gt; to open the file for editing in TextEdit.&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;open&lt;/code&gt; on a directory will take you straight to that directory in a Finder window. This is especially useful for bringing up the current directory by typing &lt;code&gt;open .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Remember that the integration between Finder and Terminal goes both ways – if you drag a file from Finder into a Terminal window, its full path gets pasted into the command line.&lt;/p&gt;

&lt;h2 id=&quot;pbcopy-and-pbpaste&quot;&gt;2. &lt;strong&gt;pbcopy&lt;/strong&gt; and &lt;strong&gt;pbpaste&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;These two commands let you copy and paste text from the command line. Of course, you could also just use your mouse—but the real power of &lt;code&gt;pbcopy&lt;/code&gt; and &lt;code&gt;pbpaste&lt;/code&gt; comes from the fact that they’re UNIX commands, and that means they benefit from piping, redirection, and the ability to be in scripts in conjunction with other commands. Typing:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ls ~ | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…will copy a list of files in your home directory to the OS X clipboard. You can easily capture the contents of a file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ pbcopy &amp;lt; blogpost.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;..or do something crazier. This hacked-up script will grab the link of the latest Google doodle and copy it to your clipboard.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ curl http://www.google.com/doodles#oodles/archive | grep -A5 &#39;latest-doodle on&#39; | grep &#39;img src&#39; | sed s/.*&#39;&amp;lt;img src=&quot;\/\/&#39;/&#39;&#39;/ | sed s/&#39;&quot; alt=&quot;.*&#39;/&#39;&#39;/ | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Using &lt;code&gt;pbcopy&lt;/code&gt; with pipes is a great way to capture the output of a command without having to scroll up and carefully select it. This makes it easy to share diagnostic information. &lt;code&gt;pbcopy&lt;/code&gt; and &lt;code&gt;pbpaste&lt;/code&gt; can also be used to automate or speed up certain kinds of tasks. For instance, if you want to save email subject lines to a task list, you could copy the subjects from Mail.app and run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ pbpaste &amp;gt;&amp;gt; tasklist.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;mdfind&quot;&gt;3. &lt;strong&gt;mdfind&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Many a Linux power user has tried to use &lt;code&gt;locate&lt;/code&gt; to search for files on a Mac and then quickly discovered that it didn’t work. There’s always the venerable UNIX &lt;code&gt;find&lt;/code&gt; command, but OS X comes with its own killer search tool: Spotlight. So why not tap into its power from the command line?&lt;/p&gt;

&lt;p&gt;That’s exactly what &lt;code&gt;mdfind&lt;/code&gt; does. Anything Spotlight can find, &lt;code&gt;mdfind&lt;/code&gt; can find too. That includes the ability to search inside files and metadata.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mdfind&lt;/code&gt; comes with a few conveniences that make it stand out from its big blue brother. For instance, the &lt;code&gt;-onlyin&lt;/code&gt; flag can restrict the search to a single directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ mdfind -onlyin ~/Documents essay
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;mdfind&lt;/code&gt; database should stay up to date in the background, but you can also troubleshoot it (as well as Spotlight) using &lt;code&gt;mdutil&lt;/code&gt;. If Spotlight isn’t working the way it should, &lt;code&gt;mdutil -E&lt;/code&gt; will erase the index and rebuild it from scratch. You can also turn off indexing entirely with &lt;code&gt;mdutil -i off&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;screencapture&quot;&gt;4. &lt;strong&gt;screencapture&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;screencapture&lt;/code&gt; lets you take many different kinds of screenshots. It’s similar to &lt;strong&gt;Grab.app&lt;/strong&gt; and the keyboard shortcuts &lt;kbd&gt;cmd&lt;/kbd&gt; + &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;3&lt;/kbd&gt; and &lt;kbd&gt;cmd&lt;/kbd&gt; + &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;4&lt;/kbd&gt;, except it’s far more flexible. Here are just a few different ways you can use &lt;code&gt;screencapture&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;Capture the contents of the screen, including the cursor, and attach the resulting image (named ‘image.png’) to a new Mail message:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ screencapture -C -M image.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Select a window using your mouse, then capture its contents without the window’s drop shadow and copy the image to the clipboard:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ screencapture -c -W
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Capture the screen after a delay of 10 seconds and then open the new image in Preview:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ screencapture -T 10 -P image.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Select a portion of the screen with your mouse, capture its contents, and save the image as a pdf:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ screencapture -s -t pdf image.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To see more options, type &lt;code&gt;screencapture --help&lt;/code&gt; &lt;/p&gt;

&lt;h2 id=&quot;launchctl&quot;&gt;5. &lt;strong&gt;launchctl&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;launchctl&lt;/code&gt; lets you interact with the OS X init script system, &lt;code&gt;launchd&lt;/code&gt;. With launch daemons and launch agents, you can control the services that start up when you boot your computer. You can even set up scripts to run periodically or at timed intervals in the background, similar to cron jobs on Linux.&lt;/p&gt;

&lt;p&gt;For example, if you’d like to have the Apache web server start automatically when you turn on your Mac, simply type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Running &lt;code&gt;launchctl list&lt;/code&gt; will show you what launch scripts are currently loaded. &lt;code&gt;sudo launchctl unload [path/to/script]&lt;/code&gt; will stop and unload running scripts, and adding the &lt;code&gt;-w&lt;/code&gt; flag will remove those scripts permanently from your boot sequence. I like to run this one on all the auto-update “helpers” created by Adobe apps and Microsoft Office.&lt;/p&gt;

&lt;p&gt;Launchd scripts are stored in the folllowing locations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~/Library/LaunchAgents    
/Library/LaunchAgents          
/Library/LaunchDaemons
/System/Library/LaunchAgents
/System/Library/LaunchDaemons
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To see what goes into a launch agent or daemon, there’s a great blog post by &lt;a href=&quot;http://paul.annesley.cc/2012/09/mac-os-x-launchd-is-cool/&quot;&gt;Paul Annesley&lt;/a&gt; that walks you through the file format. And if you’d like to learn how to write your own &lt;code&gt;launchd&lt;/code&gt; scripts, Apple provides some helpful documentation on their &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html&quot;&gt;Developer site&lt;/a&gt;. There’s also the fantastic &lt;a href=&quot;http://www.peterborgapps.com/lingon/&quot;&gt;Lingon&lt;/a&gt; app if you’d prefer to avoid the command line entirely.&lt;/p&gt;

&lt;h2 id=&quot;say&quot;&gt;6. &lt;strong&gt;say&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;This is a fun one: &lt;code&gt;say&lt;/code&gt; converts text to speech, using the same TTS engine OS X uses for &lt;a href=&quot;http://www.apple.com/accessibility/osx/voiceover/&quot;&gt;VoiceOver&lt;/a&gt;. Without any options, &lt;code&gt;say&lt;/code&gt; will simply speak whatever text you give it out loud.:&lt;sup id=&quot;fnref:mac&quot;&gt;&lt;a href=&quot;#fn:mac&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ say &quot;Never trust a computer you can&#39;t lift.&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can also use &lt;code&gt;say&lt;/code&gt; to speak the contents of a text file with the &lt;code&gt;-f&lt;/code&gt; flag, and you can store the resulting audio clip with the &lt;code&gt;-o&lt;/code&gt; flag:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ say -f mynovel.txt -o myaudiobook.aiff
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;say&lt;/code&gt; command can be useful in place of console logging or alert sounds in scripts. For instance, you can set up an Automator or &lt;a href=&quot;http://www.noodlesoft.com/hazel.php&quot;&gt;Hazel&lt;/a&gt; script to do batch file processing and then announce the task’s completion with &lt;code&gt;say&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But the most enjoyable use for &lt;code&gt;say&lt;/code&gt; is rather more sinister: if you have &lt;code&gt;ssh&lt;/code&gt; access to a friend or coworker’s Mac, you can silently log into their machine and haunt them through the command line. Give ‘em a Siri-ous surprise.&lt;/p&gt;

&lt;p&gt;You can set the voice (and language!) used by &lt;code&gt;say&lt;/code&gt; by changing the default setting in the &lt;strong&gt;Dictation &amp;amp; Speech&lt;/strong&gt; panel in System Preferences.&lt;/p&gt;

&lt;h2 id=&quot;diskutil&quot;&gt;7. &lt;strong&gt;diskutil&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;diskutil&lt;/code&gt; is a command line interface to the &lt;strong&gt;Disk Utility&lt;/strong&gt; app that comes with OS X. It can do everything its graphical cousin can, but it also has some extra capabilities—such as filling a disk with zeroes or random data. Simply type &lt;code&gt;diskutil list&lt;/code&gt; to see the path names of disks and removable media attached to your machine, and then point the command at the volume you want to operate on. Be careful: &lt;code&gt;diskutil&lt;/code&gt; can permanently destroy data if it’s used incorrectly.&lt;/p&gt;

&lt;h2 id=&quot;brew&quot;&gt;8. &lt;strong&gt;brew&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;Alright–this isn’t technically a native command. But no OS X power user should be without &lt;a href=&quot;http://brew.sh&quot;&gt;Homebrew&lt;/a&gt;. The website calls it “The missing package manager for OS X,” and that couldn’t be truer. If you’ve ever used &lt;code&gt;apt-get&lt;/code&gt; in Linux, you will feel right at home in Homebrew.&lt;sup id=&quot;fnref:compiling&quot;&gt;&lt;a href=&quot;#fn:compiling&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew&lt;/code&gt; gives you easy access to thousands of free utilities and libraries from the open source community. For instance, &lt;code&gt;brew install imagemagick&lt;/code&gt; will set you up with &lt;a href=&quot;http://www.imagemagick.org&quot;&gt;ImageMagick&lt;/a&gt;, a powerful utility that makes it possible to do anything from whipping up animated gifs to converting images between dozens of different types. &lt;code&gt;brew install node&lt;/code&gt; will introduce you to &lt;a href=&quot;http://nodejs.org&quot;&gt;NodeJS&lt;/a&gt;, the hot new tool for developing and running server-side JavaScript apps.&lt;/p&gt;

&lt;p&gt;You can have fun with Homebrew too: &lt;code&gt;brew install archey&lt;/code&gt; will get you &lt;strong&gt;Archey&lt;/strong&gt;, a cool little script for displaying your Mac’s specs next to a colourful Apple logo. The selection in Homebrew is huge—and because it’s so easy to create &lt;a href=&quot;https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook&quot;&gt;formulas&lt;/a&gt;, new packages are being added all the time.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/archey.png&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;Archey&amp;mdash;&lt;/span&gt;My command line brings all the boys to the yard.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;But the best part about Homebrew? It keeps all its files in a single directory: &lt;code&gt;/usr/local/&lt;/code&gt;. That means you can install newer versions of system software, such as &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;mysql&lt;/code&gt;, without interfering with the built-in equivalents. And if you ever want to get rid of your Homebrew installation, it’s easy to remove. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Edit—May 15:&lt;/em&gt; Someone suggested to me that that you should not blindly delete the contents of &lt;code&gt;/usr/local/&lt;/code&gt;. That’s a fair precaution. To remove Homebrew safely, use the &lt;a href=&quot;https://gist.github.com/mxcl/1173223&quot;&gt;uninstall script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more fun with &lt;strong&gt;Terminal.app&lt;/strong&gt;, here is an A-Z list of &lt;a href=&quot;http://ss64.com/osx/&quot;&gt;all available console commands in OS X 10.9 Mavericks&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:bundles&quot;&gt;
      &lt;p&gt;Recall that OS X apps are not true executables, but actually special directories (bundles) with the extension &lt;em&gt;.app&lt;/em&gt;. &lt;code&gt;open&lt;/code&gt; is the only way to launch these programs from the command line. It can also launch  other “files” that are truly bundles, such as Pages documents.  &lt;a href=&quot;#fnref:bundles&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:mac&quot;&gt;
      &lt;p&gt;https://www.youtube.com/watch?v=G0FtgZNOD44 &lt;a href=&quot;#fnref:mac&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:compiling&quot;&gt;
      &lt;p&gt;In truth, Homebrew is more similar to FreeBSD’s Ports system than Linux’s apt. It uses a hybrid source/binary system: if no binary is available for a particular package it will simply download the source tarball and compile it—not a problem on today’s multicore Macs. &lt;a href=&quot;#fnref:compiling&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Wed, 14 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/os-x-terminal/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/os-x-terminal/</guid>
            </item>
        
            <item>
                <title>Coding for Journalists, Part 2: HTML — Workflows, Nesting and Paragraphs</title>
                <description>&lt;p&gt;In &lt;a href=&quot;/2014/coding-for-journalists-p1/&quot;&gt;Part 1&lt;/a&gt;, we set up our environment and tested it out with a little HTML code. More importantly, we built a basic &lt;strong&gt;coding workflow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Having and practicing a good workflow is important—not just for the sake of productivity, but because every project is different. A new employer might mean having to learn a new CMS, for instance, or even a new programming language. That’s why it’s important not to learn specific tools, but to have simple procedures that you know well and can fall back on.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Your new coding environment might not be as fancy as something like &lt;a href=&quot;http://www.codecademy.com&quot;&gt;Codeacademy&lt;/a&gt;, but it will work anywhere, from your blog to the Huffington Post. To recap, the steps in our HTML workflow are:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write your prose and code in a text editor.&lt;/li&gt;
  &lt;li&gt;Save the file with the extension &lt;code&gt;.html&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Double-click the HTML file to view it in your web browser.&lt;/li&gt;
  &lt;li&gt;Make changes and corrections to your code, re-save the file, and reload the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that we’re comfortable with this process, it’s time to learn more HTML.&lt;/p&gt;

&lt;h2 id=&quot;nesting&quot;&gt;Nesting&lt;/h2&gt;

&lt;p&gt;As we saw in Part 1, HTML is a language of tags. There are a few dozen tags in &lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/Guide/HTML/HTML5/HTML5_element_list&quot;&gt;HTML5&lt;/a&gt; (down from well over a hundred in HTML4). We’ll learn what many of them are for, but first let’s take a look at what they all have in common.&lt;/p&gt;

&lt;p&gt;HTML tags interact in predictable ways. One features of tags is that they can &lt;strong&gt;nest&lt;/strong&gt;, stacking together like Russian dolls. Nested tags inherit the properties of their surrounding tags. For instance, this line of code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;strong&amp;gt;&amp;lt;em&amp;gt;It was the best of times, it was the blurst of times.&amp;lt;/em&amp;gt;&amp;lt;/strong&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…produces the following output:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;&lt;em&gt;It was the best of times, it was the blurst of times.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag encapsulates the &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag, which encloses the text on the inside. Both tags apply their respective formatting inward, causing the contents to be rendered in both bold and italic.&lt;/p&gt;

&lt;p&gt;Tag nesting does not have to be symmetrical:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;strong&amp;gt;It was the best of times, &amp;lt;em&amp;gt;it was was the blurst of times.&amp;lt;/em&amp;gt;&amp;lt;/strong&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;It was the best of times, &lt;em&gt;it was was the blurst of times.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this case, the &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag applies to the entire line, but the &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag only affects the second half.&lt;/p&gt;

&lt;p&gt;Notice that in both examples, the tags are closed in reverse order from how they were opened. This pattern is called &lt;strong&gt;Last In, First Out (LIFO).&lt;/strong&gt; Following this practice in your own code is crucial. The innermost opening tag should &lt;em&gt;always&lt;/em&gt; get the innermost closing tag. The outermost opening tag should &lt;em&gt;always&lt;/em&gt; get the outermost closing tag.&lt;/p&gt;

&lt;p&gt;This line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;strong&amp;gt;&amp;lt;em&amp;gt;Please don&#39;t do this.&amp;lt;/strong&amp;gt;&amp;lt;/em&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;…is bad HTML. So is this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;em&amp;gt;&amp;lt;strong&amp;gt;Also don&#39;t do&amp;lt;/em&amp;gt; this. Please.&amp;lt;/strong&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you ignore my advice and type these lines of code into your text editor (try it!) they will still work as expected. HTML is designed to be resilient, and browsers are forgiving of simple mistakes.&lt;sup id=&quot;fnref:nesting&quot;&gt;&lt;a href=&quot;#fn:nesting&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; But why learn bad habits? Learn to nest correctly. &lt;strong&gt;LIFO.&lt;/strong&gt;&lt;sup id=&quot;fnref:fifo&quot;&gt;&lt;a href=&quot;#fn:fifo&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;h3 id=&quot;parents-children-and-siblings&quot;&gt;Parents, children, and siblings&lt;/h3&gt;

&lt;p&gt;Tags can be on the outside of other tags (“parents”), inside other tags (“children”), or at the same level as other tags in the tag hierarchy (“siblings”). This line of code contains parent, child and sibling tags:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;em&amp;gt;&amp;lt;strong&amp;gt;All TV&amp;lt;/strong&amp;gt; and no beer make Homer &amp;lt;strong&amp;gt;go crazy.&amp;lt;/strong&amp;gt;&amp;lt;/em&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;&lt;strong&gt;All TV&lt;/strong&gt; and no beer make Homer &lt;strong&gt;go crazy.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this example, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; is a parent tag with two children (the two &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tags). The &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tags are siblings to each other. Child tags inherit properties from parent tags, but tags don’t have any effect on their siblings. Child tags can also be parents to their own child tags—passing down their own traits along with those of the original parents (“grandparents”).&lt;/p&gt;

&lt;p&gt;As you can imagine, nesting more than a few tags together can make your code  difficult to read—and almost impossible to bugfix. When your code involves multiple levels of tags, consider formatting it in &lt;strong&gt;indented style.&lt;/strong&gt; The above example could be written out like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;em&amp;gt;
    &amp;lt;strong&amp;gt;All TV&amp;lt;/strong&amp;gt; and no beer make Homer
    &amp;lt;strong&amp;gt;go crazy.&amp;lt;/strong&amp;gt;
&amp;lt;/em&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On each new line, hit the &lt;kbd&gt;tab&lt;/kbd&gt; key to indent child tags and line up sibling tags. Your text editor will keep track of what level you’re on when you press &lt;kbd&gt;enter&lt;/kbd&gt;. To go “up” a level, press &lt;kbd&gt;backspace&lt;/kbd&gt; at the beginning of a line. You can also select one or more lines of code and press &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;tab&lt;/kbd&gt; to unindent them by a single level. Because it’s a good habit to get into, I’ll be using indented style for most examples from now on.&lt;/p&gt;

&lt;p&gt;There is no limit to how deep the tag hierarchy can go—grandchildren, great-grandchildren, etc.—or how many sibling tags can exist at a particular level. As a matter of fact, most webpages are built with long and intricate &lt;strong&gt;tag trees.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But no matter how many tall the tree gets or how many branches it sprouts, the same principle applies everywhere: child tags inherit all the inheritable properties of their parents (and grandparents, and great-grandparents…). For this reason, writing good HTML is as much about &lt;em&gt;structuring&lt;/em&gt; your tags as it is about choosing them.&lt;/p&gt;

&lt;h2 id=&quot;whitespace-and-the-paragraph-tag-p&quot;&gt;Whitespace and the Paragraph Tag: &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;Whitespace in HTML is insignifcant. Extra spaces, tabs and line breaks are treated by web browsers as if they weren’t there at all:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;strong&amp;gt;This&amp;lt;/strong&amp;gt;       is
        weirdly-formatted

and ugly&amp;lt;em&amp;gt; but
&amp;lt;/em&amp;gt;            
  technically correct
              code.
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;&lt;strong&gt;This&lt;/strong&gt; is weirdly-formatted and &lt;em&gt;ugly&lt;/em&gt; but technically correct code.&lt;/blockquote&gt;

&lt;p&gt;Because HTML ignores whitespace, you have the freedom to format your code however you like (such as in the indented style demonstrated above). But this little “feature” creates problems for writers who need the ability to write in paragraphs:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;This is &amp;lt;strong&amp;gt;one&amp;lt;/strong&amp;gt; paragraph.

This is supposed to be &amp;lt;strong&amp;gt;another&amp;lt;/strong&amp;gt; paragraph.
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;This is &lt;strong&gt;one&lt;/strong&gt; paragraph. This is supposed to be &lt;strong&gt;another&lt;/strong&gt; paragraph.&lt;/blockquote&gt;

&lt;p&gt;Unless you instruct the browser otherwise, your beautifully-crafted  paragraphs will all be smushed together onto one line. Thankfully, there’s a tag for that. Using the HTML &lt;strong&gt;paragraph tag&lt;/strong&gt; &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, we can get the expected behaviour:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;
    This is &amp;lt;strong&amp;gt;one&amp;lt;/strong&amp;gt; paragraph.
&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;
    This is supposed to be &amp;lt;strong&amp;gt;another&amp;lt;/strong&amp;gt; paragraph.
&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;&lt;p&gt;This is &lt;strong&gt;one&lt;/strong&gt; paragraph.&lt;/p&gt;&lt;p&gt;This is supposed to be &lt;strong&gt;another&lt;/strong&gt; paragraph.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Like most tags, the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag has an opening tag and a closing tag: &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt; It’s good practice to wrap every paragraph in &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags. Not only will they get the proper amount of line-spacing, but also the correct fonts, colours, and formatting that your site has set up for body copy.&lt;sup id=&quot;fnref:br&quot;&gt;&lt;a href=&quot;#fn:br&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Manually inserting &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags between paragraphs is one of the most tedious parts of writing prose in HTML. For that reason, coders and writers have come up with several ways to make the task easier: &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;WordPress&lt;/strong&gt; will automatically convert blank lines into paragraph breaks. If you know your code will be going into WordPress, simply ignore the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag and press enter twice between paragraphs. Then copy your code into the WordPress text editor and submit your post. Other CMSes may also have an option to work this way.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://bywordapp.com/markdown/guide.html&quot;&gt;Markdown&lt;/a&gt; treats blank lines as paragraph breaks, just like WordPress. Many CMSes support Markdown either natively or with plugins.&lt;/li&gt;
  &lt;li&gt;Use the &lt;strong&gt;Find&lt;/strong&gt; feature in your text editor to search for line breaks and replace them with &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags. Write your article with blank lines between paragraphs, and then use a &lt;a href=&quot;http://regex.bastardsbook.com&quot;&gt;regular expression&lt;/a&gt; to replace &lt;code&gt;\n\n&lt;/code&gt; (two consecutive line breaks) with &lt;code&gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/regexp.png&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;Replacing paragraph breaks with tags&amp;mdash;&lt;/span&gt;In &lt;strong&gt;TextWrangler&lt;/strong&gt;, go to &lt;strong&gt;Search -&amp;gt; Find&lt;/strong&gt; and set up the above search. Make sure &#39;Grep&#39; is checked. Hit &lt;strong&gt;Replace All&lt;/strong&gt;. Afterward, you will need to add a single opening &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag before your first paragraph and a single closing tag after your last.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Alternatively, just get used to writing &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; a whole lot. It’s not so bad. Better than manually fixing the multi-column layout in your coworker’s Word document &lt;span style=&quot;font-family: &#39;comic sans ms&#39;&quot;&gt;&lt;strong&gt;which for some inexcusable reason was set in Comic Sans MS.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;In Part 3, we’ll see the dozen or so HTML tags every writer should know.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:nesting&quot;&gt;
      &lt;p&gt;Just as browsers will forgive out-of-order nesting, they will also try to make sense of your code if you accidentally leave out closing tags. Depending on various factors, an unclosed tag will apply to the rest of the section or the rest of the &lt;em&gt;entire page&lt;/em&gt;. This is probably not what you intended to happen. So nest properly, and close your tags. &lt;a href=&quot;#fnref:nesting&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:fifo&quot;&gt;
      &lt;p&gt;The pattern opposite, found in certain programming languages, is FIFO: First In First Out. &lt;a href=&quot;#fnref:fifo&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:br&quot;&gt;
      &lt;p&gt;The &lt;strong&gt;line break tag&lt;/strong&gt; &amp;lt;br&amp;gt; creates one or more manual line breaks between blocks of text. Using multiple &amp;lt;br&amp;gt; tags is a little like hitting ‘enter’ a bunch of times in Word. But &amp;lt;br&amp;gt; does not come with any of the formatting benefits of the &amp;lt;p&amp;gt; tag. It can cause ugly layout inconsistencies. Use it only as a last resort. &lt;a href=&quot;#fnref:br&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Tue, 13 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/coding-for-journalists-p2/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/coding-for-journalists-p2/</guid>
            </item>
        
            <item>
                <title>Coding for Journalists, Part 1: Text Editing and First Steps with HTML</title>
                <description>&lt;p&gt;All code, no matter the language, is written in plain text. Plain text documents are those that don’t allow for any formatting, such as applying fonts, colours, and sizes. Documents that permit formatting are called rich text.&lt;/p&gt;

&lt;p&gt;Rich text is what you produce in Microsoft Word or the visual editor in your CMS. Another name for it is &lt;abbr title=&quot;What You See is What You Get&quot;&gt;WYSIWYG&lt;/abbr&gt;. But plain text is the only format web browsers truly understand. To start writing HTML, you’ll need to to write plain text with a &lt;strong&gt;text editor.&lt;/strong&gt;
&lt;!--more--&gt;&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/plaintext.png&quot; width=&quot;49%&quot; /&gt;
    &lt;img src=&quot;/public/img/richtext.png&quot; width=&quot;49%&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;Plain and Rich&amp;mdash;&lt;/span&gt; Even if we were to change the font in the right document to match that of the left, it still wouldn&#39;t be plain text. It&#39;s the underlying file format that counts.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&quot;choose-your-editor&quot;&gt;Choose your editor&lt;/h2&gt;

&lt;p&gt;In the hands of a skilled coder, a text editor is like a Jedi’s lightsaber: &lt;em&gt;not as clumsy or random as a word processor. An elegant weapon, for a more civilized age.&lt;/em&gt; Armed with her trusty text editor, a coder can whip up anything from a blog post to the next Facebook. The only limits are her imagination, her free time, and her venture capital.&lt;/p&gt;

&lt;p&gt;Which text editor you decide to code with is a matter of personal taste. Like any tool, use the one you find most comfortable. Since plain text is a free and open format, you can always switch later.&lt;/p&gt;

&lt;p&gt;Windows and OS X come with &lt;strong&gt;Notepad&lt;/strong&gt; and &lt;strong&gt;TextEdit&lt;/strong&gt;, respectively. They can both get the job done, but they’re missing some helpful quality-of-life features. Two fantastic and free alternatives are &lt;a href=&quot;http://www.notepad-plus-plus.org&quot;&gt;Notepad++&lt;/a&gt; for PCs and &lt;a href=&quot;http://barebones.com/products/textwrangler/&quot;&gt;TextWrangler&lt;/a&gt; for the Mac. For the rest of this series, we’ll assume you’re using one of these apps.&lt;/p&gt;

&lt;p&gt;Text editors are for more than just code. They’re ideal for writing, too. There are &lt;a href=&quot;http://bettermess.com/a-plain-text-primer/&quot;&gt;many reasons&lt;/a&gt; to do your online writing in plain text, and I won’t &lt;a href=&quot;http://www.macworld.com/article/1161549/forget_fancy_formatting_why_plain_text_is_best.html&quot;&gt;cover them&lt;/a&gt; in this post. But the most important reason is quite simple: &lt;strong&gt;everything you publish on the web ends up as plain text.&lt;/strong&gt; Specifically, it ends up as HTML.&lt;/p&gt;

&lt;p&gt;Even if you write your articles in Google Drive or MS Word, they’re going to be converted to plain text and HTML at some point. (And if you’ve ever copied and pasted from Word into WordPress, you’ll know that plenty gets lost in translation.)&lt;/p&gt;

&lt;p&gt;If you write online, you’ll find you just can’t avoid plain text and HTML—no matter how hard you try. So skip the middleman: practice coding &lt;em&gt;and&lt;/em&gt; writing in your text editor. It will make your life much simpler.&lt;sup id=&quot;fnref:format&quot;&gt;&lt;a href=&quot;#fn:format&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;h2 id=&quot;get-your-code-on&quot;&gt;Get your code on&lt;/h2&gt;

&lt;p&gt;Once you’ve downloaded and installed a text editor, open it up to a blank document. Since you’re a writer, the first thing you’ll want to do is turn on word wrap:&lt;sup id=&quot;fnref:wrap&quot;&gt;&lt;a href=&quot;#fn:wrap&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/wrap_tw.png&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;Enabling word wrap&amp;mdash;&lt;/span&gt;In &lt;strong&gt;TextWrangler&lt;/strong&gt;, click the &lt;strong&gt;T&lt;/strong&gt; in the top left corner and choose &lt;em&gt;Soft Wrap Text&lt;/em&gt;. In &lt;strong&gt;Notepad++&lt;/strong&gt;, go to the &lt;strong&gt;View&lt;/strong&gt; menu and choose &lt;em&gt;Word wrap&lt;/em&gt;.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Next, copy or type the following line of code into your editor:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Hello &amp;lt;strong&amp;gt;World&amp;lt;/strong&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Save your document. Name it &lt;code&gt;helloworld.html&lt;/code&gt;. (Make sure the extension is &lt;code&gt;.html&lt;/code&gt; and not &lt;code&gt;.txt&lt;/code&gt; or &lt;code&gt;.html.txt&lt;/code&gt;.) Save it to the Desktop or a folder where you can easily find it.&lt;sup id=&quot;fnref:src&quot;&gt;&lt;a href=&quot;#fn:src&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; If you’ve named the file correctly, your editor will recognize that you’re writing HTML code and highlight the &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tags in a distinctive colour.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/helloworld_tw.png&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;MY FIRST HTML&amp;mdash;&lt;/span&gt;I saved my document as &lt;code&gt;helloworld.html&lt;/code&gt; and TextWrangler gave me purple code for my efforts. Your colours might be different.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Once you’ve saved your &lt;code&gt;helloworld.html&lt;/code&gt; file, locate it in your file manager and double-click it. It should launch your computer’s default web browser. If that doesn’t happen, right click on the file and select &lt;strong&gt;Open With&lt;/strong&gt;, then choose your browser. You should then see your new HTML page in its full glory:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/helloworld.png&quot; /&gt;
    &lt;figcaption&gt;&lt;span class=&quot;elegant&quot;&gt;A webpage&amp;mdash;&lt;/span&gt; If you see something else (for instance, bits and pieces of the word &lt;strong&gt;&amp;lt;strong&amp;gt;&lt;/strong&gt;) or no formatting at all, go back and double-check the line of code above. Then save your file and try again. If you are using TextEdit on Mac, make sure you&#39;re in plain text mode (&lt;strong&gt;Format &amp;gt; Make Plain Text&lt;/strong&gt;). If you&#39;re using MS Word... don&#39;t be.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;At this point, you likely have a good of what it is that &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; does. Web browsers will &lt;b&gt;bolden&lt;/b&gt; any text between &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; and its closing tag, &lt;code&gt;&amp;lt;/strong&amp;gt;&lt;/code&gt;. (All closing tags begin with a forward slash, &lt;strong&gt;”/”&lt;/strong&gt;.)&lt;/p&gt;

&lt;p&gt;Let’s try a different tag. Go back to your file and change the opening &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag to &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;. Do the same to its closing tag: &lt;code&gt;&amp;lt;/em&amp;gt;&lt;/code&gt;. Your code should look now like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Hello &amp;lt;em&amp;gt;World&amp;lt;/em&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Save your file, then go back to your web browser and refresh the page (&lt;kbd&gt;⌘&lt;/kbd&gt;+&lt;kbd&gt;R&lt;/kbd&gt; on a Mac, or &lt;kbd&gt;F5&lt;/kbd&gt; on Windows). You will need to refresh your browser whenever you make changes to an HTML file for those changes to show up. You should now see this in your browser:&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&quot;/public/img/helloworld_it.png&quot; /&gt;
&lt;/figure&gt;

&lt;p&gt;Simple stuff. The &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag tells the browser to make text &lt;strong&gt;strong&lt;/strong&gt; (bold), and the &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag tells the browser to &lt;em&gt;emphasize&lt;/em&gt; (italicize) it.&lt;sup id=&quot;fnref:html5&quot;&gt;&lt;a href=&quot;#fn:html5&quot; class=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; Tags, or elements, are all the words between triangle brackets. They’re visible in your text editor but not in your web browser. Closing tags begin with slashes. Any text between opening and closing tags is affected by those tags. If you grasp these points, you fundamentally understand HTML.&lt;/p&gt;

&lt;p&gt;Of course, the rabbit hole goes much deeper—as we will soon see. For now, practice writing longer blocks of text and formatting them with &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt;. Try these exercises:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Combine multiple &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tags.&lt;/li&gt;
  &lt;li&gt;Put an &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag right next to a &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag.&lt;/li&gt;
  &lt;li&gt;See what happens when you leave out a closing tag.&lt;/li&gt;
  &lt;li&gt;Go wild. Don’t worry. You can’t break anything. (At least, not until we get to JavaScript!)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next time, we’ll go into more detail about the way tags behave and what happens when they shack up with other tags. Are you sick of the word “tag” yet? I hope not. See you soon.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:format&quot;&gt;
      &lt;p&gt;If you’re already kinda familiar with HTML and want to start doing more of your writing in plain text, &lt;a href=&quot;http://code.tutsplus.com/tutorials/markdown-the-ins-and-outs--net-25482&quot;&gt;Markdown&lt;/a&gt; is for you. &lt;a href=&quot;#fnref:format&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:wrap&quot;&gt;
      &lt;p&gt;Web developers don’t typically use word wrap. Instead, they follow a convention of manually limiting each line of code to 80 characters long. But when you’re composing paragraphs, having to press &lt;kbd&gt;enter&lt;/kbd&gt; once every 80 characters gets pretty ridiculous. So turn on word wrap, but try to respect the rule when writing lines that only contain code. &lt;a href=&quot;#fnref:wrap&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:src&quot;&gt;
      &lt;p&gt;For bonus nerd points, save all your code to a folder named &lt;b&gt;src&lt;/b&gt; (short for “source [code]”). &lt;a href=&quot;#fnref:src&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:html5&quot;&gt;
      &lt;p&gt;If you learned HTML several years ago, you may be wondering why I’m using &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;. We’re already running into a major change in HTML5, which does away with tags that are strictly presentational in favour of tags that are &lt;em&gt;semantic&lt;/em&gt;. We’ll learn more about this soon. &lt;a href=&quot;#fnref:html5&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Tue, 06 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/coding-for-journalists-p1/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/coding-for-journalists-p1/</guid>
            </item>
        
            <item>
                <title>Coding for Journalists, Part 0: Why Code?</title>
                <description>&lt;p&gt;&lt;a href=&quot;http://www.niemanlab.org/2012/09/miranda-mulligan-want-to-produce-hirable-grads-journalism-schools-teach-them-to-code/&quot;&gt;Learn to code&lt;/a&gt;, they say.&lt;/p&gt;

&lt;p&gt;It’s advice that most of us have heard at school or in a newsroom, but that few of us ever really act upon.&lt;/p&gt;

&lt;p&gt;And no, it’s not because we aren’t &lt;a href=&quot;http://j-source.ca/article/opinion-why-journalism-schools-must-teach-code—even-if-every-journalist-not-wired-way&quot;&gt;wired that way&lt;/a&gt;. We’re smart, adaptable people. The trouble with coding is that it’s so detached from what we know and what we’re good at. We’re writers, researchers, and reporters. That’s our trade. We don’t have the time or motivation to futz around with arcane syntax, any more than we have the time to learn plumbing. We’re just not interested. We’d rather be writing.
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;Advocates for teaching code like to go on about “digital literacy” and how important it is. They’ll tell you that you need to start learning code &lt;em&gt;right this second&lt;/em&gt; because otherwise no one will hire you, ever, and, hey, you’re missing out, so-get-with-the-program-already. They mean well, but I’m not a fan of this line of reasoning. Not only is it condescending to call educated people illiterate for not possessing a skill outside of their field, but you won’t encourage &lt;em&gt;anyone&lt;/em&gt; to step out of their comfort zone and learn something new by guilting them into doing it.&lt;sup id=&quot;fnref:driver&quot;&gt;&lt;a href=&quot;#fn:driver&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Truth is, it isn’t necessary for the whole world to learn how to code. People in most professions can ignore programming entirely and not be any worse off for it. Not everyone needs to be make an app or be a &lt;a href=&quot;https://www.youtube.com/watch?v=dFUlAQZB9Ng&quot;&gt;badass hacker&lt;/a&gt;. There’s little point in code-for-code’s-sake, and less point in teaching programming to every single person in college or kindergarten, or whenever we’re supposed to have learned it.&lt;/p&gt;

&lt;p&gt;That said, a certain kind of coding &lt;em&gt;is&lt;/em&gt; useful for journalists who write on the web. And in 2014, that means pretty much all of us. That alone is a good enough reason to learn what practical coding is all about and how (and why) we should integrate it into our work.&lt;/p&gt;

&lt;p&gt;Of course, that’s easier said than done. The online tutorials that exist are, for the most part, unhelpful and irrelevant. They’re out of date, teaching code and techniques that were current in the mid-00s or earlier. But even the good resources are geared toward developers and designers, not writers. They cover topics we don’t need to know about, and leave out others that we should. They don’t teach us how code can actually enrich our online writing and help us work more efficiently. (Most of us aren’t even aware that code &lt;em&gt;can&lt;/em&gt; help us work more efficiently.)&lt;/p&gt;

&lt;p&gt;Yes, it’s possible to code up flashy animations, interactive features, and data-stuffed bonanzas. But we can also use code on a smaller scale in our day-to-day writing. The goal of this series is to show you how.&lt;/p&gt;

&lt;h2 id=&quot;who-is-this-for&quot;&gt;Who is this for?&lt;/h2&gt;

&lt;p&gt;This series of posts is aimed at journalists and other kinds of writers. For that reason, it’s going to follow a different path from most “Intro to HTML” tutorials.&lt;sup id=&quot;fnref:hyper&quot;&gt;&lt;a href=&quot;#fn:hyper&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; You won’t learn how to build a website or app from scratch (although you could certainly go on to do just that), but you will learn languages, techniques and best practices that you can apply whenever you make content for the web.&lt;/p&gt;

&lt;p&gt;Apart from code itself, we’re going to cover tools that can make you &lt;a href=&quot;https://www.youtube.com/watch?v=xK0njkATf84&amp;amp;feature=kp&quot;&gt;happier and more productive&lt;/a&gt; as a digital creator, such as version control, secure backups, and writing in Markdown. These topics are outside the scope of a typical web development course, but they’re incredibly useful for anyone who writes online.&lt;/p&gt;

&lt;p&gt;If you’ve put off learning HTML at least a dozen times before, this is the series for you. If you know some web programming but begrudge having to use it, I hope I can change your mind. Code isn’t just a last-ditch resort for when WordPress is screwing up your formatting; it’s something you can learn to appreciate on its terms. That’s because it’s the simplest and most direct way of manipulating the web.&lt;/p&gt;

&lt;p&gt;The idea is to go from “knowing” HTML to &lt;em&gt;using&lt;/em&gt; HTML in a way that’s precise and effective. Like &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Book_of_Five_Rings&quot;&gt;Miyamoto Musashi&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It’s true that getting to that stage takes some practice and time investment. But being able to work in code is worth it—not just for your resume, but to add to your personal arsenal of skills as a writer.&lt;/p&gt;

&lt;p&gt;And if you’re already an HTML pro, stick around. You might still learn a thing or two.&lt;/p&gt;

&lt;h2 id=&quot;what-were-gonna-learn&quot;&gt;What we’re gonna learn&lt;/h2&gt;

&lt;p&gt;No one who works in media needs any convincing that the web matters. In a few short years, the conversation has shifted from ‘digital” to “digital first” to “digital only.” For many of us, web has completely replaced pen and paper as our tool of the trade.&lt;/p&gt;

&lt;p&gt;So we should probably have some idea how it works. Just as print journalists should know what happens between the time when a draft leaves their desk and the newspaper hits a doorstop, web writers should have a general understanding of the technologies that power the modern Internet. That’s why one aim of this series is to provide context by explaining things like what goes on behind the scenes in your CMS when you write a post.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/HTML5_Logo_512.png&quot; style=&quot;float: right; width: 25%; height: 25%&quot; /&gt;
But before we get that far, we have to start with the basics. That includes learning about &lt;strong&gt;HTML&lt;/strong&gt;, &lt;strong&gt;CSS&lt;/strong&gt;, and &lt;strong&gt;JavaScript&lt;/strong&gt;, the trifecta of languages that make up the modern web. Of the three, HTML is by far the most relevant to writers, so we are going to spend many of these posts learning how to write it in a way that’s stylistically modern and clean. Afterward, we’ll talk about tools that can make writing code easier and more enjoyable—and come up with a web production workflow that you can use from your first draft right up until you hit “publish.”&lt;/p&gt;

&lt;p&gt;The first tutorials may seem simplistic if you’ve studied HTML before, but it may be worth your while to skim them—especially if you learned HTML more than a couple years ago. The web is always changing, and web culture and technology changes with it. This series covers &lt;strong&gt;HTML5&lt;/strong&gt;—the newest version of the venerable standard. It’s much like the earlier versions, but makes some important syntax and philosophical changes that affect even the most basic code.&lt;/p&gt;

&lt;p&gt;We’ll start later this week with &lt;strong&gt;Part 1:&lt;/strong&gt; &lt;a href=&quot;/2014/05/06/coding-for-journalists-p1&quot;&gt;Text Editing — Reppin’ It Old School&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:driver&quot;&gt;
      &lt;p&gt;Yes mum, I’ll get my driver’s license soon. Promise. I &lt;em&gt;know&lt;/em&gt; it’s embarrassing that I’m 24 and I still don’t have it. OK, technically I had it but I let it expire. But that’s besides the point. I’ll get around to it. Next month. Maybe? &lt;a href=&quot;#fnref:driver&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:hyper&quot;&gt;
      &lt;p&gt;For instance, I won’t bother explaining that HTML stands for “Hypertext Markup Language.” No one has called it that since 1993. Seriously. &lt;a href=&quot;#fnref:hyper&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
                <pubDate>Sat, 03 May 2014 00:00:00 +0000</pubDate>
                <link>http://mitchchn.me/2014/coding-for-journalists-p0/</link>
                <guid isPermaLink="true">http://mitchchn.me/2014/coding-for-journalists-p0/</guid>
            </item>
        
    </channel>
</rss>