Inquisitive Cocoa

Unless otherwise stated all code is released under the MIT License
10th April ‘12

+ imageWithPDFNamed: …

@interface UIImage (AJKImageWithPDF)
 
+ (UIImage *)imageWithPDFNamed:(NSString *)pdfName;
+ (UIImage *)imageWithPDFNamed:(NSString *)pdfName scale:(CGFloat)scale;
 
@end

A small category for iOS to create an image from a .pdf file with as little fuss as possible: UIImage+WithPDF.

Cocoa, iOS, Objective-C, SourceAdd your thoughts

2nd February ‘12

killack

#!/bin/sh
ps ax | ack $1[^/]*$ | ack -v $0 | awk '{print $1}' | xargs kill

UncategorizedAdd your thoughts

Here’s this mornings little productivity optimisation.. For ages I’ve had xc bound to open *.xcodeproj but that only works within the root directory of a project.. so heres a simple ruby script to open the Xcode project, either within the current working directory or within any of it’s parent directories.

require 'pathname'
 
success = FALSE
 
Pathname.getwd.ascend do | directory |
  directory.each_entry do | path |
    if path.basename.fnmatch("*.xcodeproj")
      system "open '#{directory + path}'"
      success = TRUE;
    end
  end
end
 
 
print "  Couldn't find an *.xcodeproj file for the '#{Pathname.getwd}' directory\n\n" if !success

Combined with an alias, either in your ~/.zshrc or ~/.bashrc files:

alias xc="ruby ~/Developer/Offshoots/Scripts/Open\ Xcode\ Project.rb"

Scripts, SourceAdd your thoughts

22nd September ‘10

Introducing Bezier

14th September ‘10

Going Freelance

14th January ‘10

NSString-EscapeHTMLCharacters

27th December ‘09

NSCache is slow

14th August ‘09

As seen via gcc

Categories & Tags:
By Date: