Skip to content

Instantly share code, notes, and snippets.

View dfjdejulio's full-sized avatar
💽
I haz a status now.

Doug DeJulio dfjdejulio

💽
I haz a status now.
View GitHub Profile
@dfjdejulio
dfjdejulio / 01_README.md
Last active August 29, 2015 14:13
Migrate from Evernote to "Notes"

I got sick of Evernote's feature creep, and decided to give "Notes.app" a try. This was partially because you can have some folders backed by Exchange, others backed by iCloud, and others backed by IMAP, so you have better control over your data.

To use this AppleScript, change the first two lines. Create the target folder in Notes.app before you run the script. (I put my work notes into my employer's Exchange server and my personal notes into iCloud for now.)

I could not find a way to set the creation date programmatically, and that's why I put it as the first line of each new note, so the information would not be lost. (I may update the script to do something similar with tags.)

@dfjdejulio
dfjdejulio / 01_README_gitignore.md
Last active August 29, 2015 14:02
Some of my default gitignore files.

Default .gitignore files

None of the .gitignore files I'm finding elsewhere seem quite right to me, so I'll keep some stashed here.

@dfjdejulio
dfjdejulio / 01_README.md
Last active August 29, 2015 14:01
Handling iOS Keyboard Show/Hide for Dummies

Handling iOS Keyboard Show/Hide for Dummies

  1. Use auto layout in your nib/xib/storyboard.
  2. Have precisely one constraint be glued to the bottom guide, and make it the highest priority.
  3. Add this class to your project.
  4. Change the class of that one special constraint to match this class.

Now, whenever the keyboard shows or hides or changes height (for example when switching between English and Japanese), the rest of your layout will automatically get out of the way.

How it works: every time the top of the keyboard moves up or down, the distance encoded in this constriant changes by the exact same amount. There's no need to initialize it or anything, it registers for the right events all by itself on being loaded from the nib/xib/storyboard. Just make sure there's only one instance of this class, and it's used by the one constraint that's glued to the bottom guide, and that you have all your other bottom-related constraints cascade from that, and it will all just work.