It's All in the Tools

It's All in the Tools

These slides are from the 2014 edition my talk "It's All in the Tools" for CocoaConf.

03000552bf9d93212d84e024f8daf275?s=128

Nathan Eror

April 25, 2014
Tweet

Transcript

  1. 2.
  2. 3.
  3. 6.
  4. 7.
  5. 8.
  6. 10.
  7. 11.
  8. 12.
  9. 13.
  10. 14.
  11. 16.

    Debugger Quick Look UIViewController+NEQuickLookDebug.m #import "UIViewController+NEQuickLookDebug.h" ! @implementation UIViewController (NEQuickLookDebug)

    ! #if DEBUG ! - (id)debugQuickLookObject { UIView *view = [self view]; UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.f); [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return snapshotImage; } ! #endif ! @end
  12. 19.
  13. 20.

    Makefile SQLITE_DB_FILE=AppData.sqlite SIMULATOR_HOME=$(HOME)/Library/Application\ Support/iPhone\ Simulator ! dbshell: find $(SIMULATOR_HOME) -name

    "$(SQLITE_DB_FILE)" -exec sqlite3 {} ';' ! killdb: find $(SIMULATOR_HOME) -name "$(SQLITE_DB_FILE)" -exec rm {} ';' ! dbschema: find $(SIMULATOR_HOME) -name "$(SQLITE_DB_FILE)" -exec sqlite3 {} .schema ';' ! dbdump: find $(SIMULATOR_HOME) -name "$(SQLITE_DB_FILE)" -exec sqlite3 {} .dump ';'
  14. 21.
  15. 22.

    Shell - Expansions $ ls screen.png $ cp screen{,_copy}.png $

    ls screen.png screen_copy.png ... $ ls screen.png $ touch file{1,2,3} $ ls file1 file2 file3 screen.png
  16. 24.
  17. 25.
  18. 27.

    Python #!/usr/bin/python ! from Quartz.CoreGraphics import * from Quartz.ImageIO import

    * ! inurl = CFURLCreateWithFileSystemPath(None, "File.jpg", kCFURLPOSIXPathStyle, False) outurl = CFURLCreateWithFileSystemPath(None, "File_thumb.jpg", kCFURLPOSIXPathStyle, False) thumb_options = { kCGImageSourceCreateThumbnailWithTransform : True, kCGImageSourceCreateThumbnailFromImageAlways : True, kCGImageSourceThumbnailMaxPixelSize : 300 }; imgsrc = CGImageSourceCreateWithURL(inurl, thumb_options) thumb_image = CGImageSourceCreateThumbnailAtIndex(imgsrc, 0, thumb_options) ! outsrc = CGImageSourceCreateWithURL(outurl, thumb_options) ! dest = CGImageDestinationCreateWithURL(outurl, CGImageSourceGetType(outsrc), 1, None) CGImageDestinationAddImage(dest, thumb_image, None) CGImageDestinationFinalize(dest)
  19. 28.