Monday, August 24, 2015

Use Markdown in Evernote

New Instructions 

Updated 2015-08-24: textutil needs to be informed of input format and Evernote has changed.



I love Brett Terpstra's Marked, and its integration with Evernote is barebones and cool. Anyway, the instructions are:
  1. Get the everwatch-turbo.rb script and put it in your ~/scripts directory (below or here on GitHub)
  2. Create a directory called ~/evernote-to-marked
  3. Run it in the background by using this in terminal (adjust if your directory is different)
    ~/scripts/everwatch-turbo.rb &

Wednesday, May 27, 2015

One of Them, One of Those, or Nothing in Swift

This is a simple data structure in swift which will store one of these -- an NSObject -- one of those (a String) or nothing at all (nil).

Tuesday, March 3, 2015

DRTabBarController: UITabBarController Replacement

If you've ever tried to put a UITabBarController inside a UINavigationController, you've run into trouble. DRTabBarController is a drop-in UITabBarController replacement that fixes this issue.

Tuesday, February 17, 2015

GameLoop in Swift

I never realized that you're not supposed to use NSTimer because it doesn't line up with the frame rate. Who knew? Anyway, here's my GameLoop class (Swift). Note: it has to extend NSObject otherwise you get weird selector-not-found errors.

Friday, January 23, 2015

Sizing Subview to Superview Using Autolayout with VFL and Cartography Using Swift

In talking with the Lead Developer of Mitosynth, I got inspired to get deep into Swift, Autolayout, and Cartography. And in the last 24 hours, I've been tearing my hair out with Autolayout in Cocoa using Swift. I finally got it down to a single question on Stackoverflow.

The answer to that question opened my eyes: Cocoa was "automatically adding constraints!" So without further ado, here are all my concepts wrapped up in one. This example uses Autolayout, VFL (using a nice category I made for Swift), and Cartography, too. Whoot!

VFL, Autolayout in Swift

I don't really understand this Visual Format Language (VFL_ stuff, and it rarely does what I want, but if you read the Apple page on it you'll get the idea. Anyway, here's an extension to use them in Swift. Substitute UIView for NSView if you're working on iOS Here is is on SO: link