Mac OSX Writing Markdown and Taking Screenshots

Background

I’m doing a lot of documentation for our current iteration. Since we’re in github quite a bit, and want to keep documentation there (and transform it later if necessary), we’re in the Markdown world.

Writing Markdown

Please not another editor. Too bad. But anyway, I’ve been using Mou – Markdown Editor for Web Developers for a few days now, and it’s just about perfect for my needs. It has a split screen view so you can see what you’re doing. No more or less than I need.

Untitled_and_RetailOrderManagementTroubleshootingFAQ_md

Screen Capture

For screen captures, I just discovered Skitch.  This is a terrific little tool that makes capturing – and subsequently naming, or dragging and dropping, or marking up images – comically simple.

The image of Mou above was captured with Skitch. As was the image below – which was captured, marked up, and simply dragged and dropped right into this post. Complete with nifty arrows and a sweet little sticky with an ‘X’ on it.  You can also change formats, crop, and pixelate, among other things.

Add_New_Post_‹_MXWest_westwideweb_com_—_WordPress

Resizing a Skitch Note

This was a little tricky for me to find. You have to first select the crop tool, and then toggle to resize mode. Although it seems the one thing I couldn’t capture with Skitch was Skitch itself (as it hides itself while you’re taking a screen capture), we can do a regular Mac screen capture, and then just open the file in Skitch. So here’s where you find resize:

Screen_Shot_2014-06-12_at_3_04_06_PM

 

Changing Mac’s Default Screenshot Save Folder

Kind of moot since I’m using the above tools, but Adam on Lifehacker describes How to Change OS X’s Default Screenshot Format and Location.

To change the default destination folder, from the command line:

defaults write com.apple.screencapture location /some/new/location

To load this new setting, from the command line:

killall SystemUIServer

 

git: Find Files Across Commits

Scenario

Needed to purge files from a repo using  BFG Repo Cleaner   as per Advance Git/ Remove Sensitive Data (at gthub.com).  Need to know that they’re there.  Need to know that they’re gone.

Git Version

git version 1.8.5.2 (Apple Git-48)

Finding File(s)

I’m using the –name-status option in all of these examples because I want to. It provides that status of the file(s) in each commit. Without –name-status, we get only the commits, not the specific file information.

Find a single file with its path. Path is relative to current directory. This can be a little odd if the file has been deleted from the current branch you’re on, since the file won’t be in your working tree, but git still wants the relative path. Maybe it just seems odd to me *shrug*.

git log --follow --name-status -- some/file/path/fileYouWant.ext

Find  a single file, but we don’t know the path. We can glob it!

git log --follow --name-status -- **/fileYouWant.ext

Find all files ending in some extension. Let’s say I want to find all js files in my repo.

git log --follow --name-status -- **/*.js

If nothing else, this will likely help future me!