This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I wish code completion would work inside of STAssert* | |
I wish the console output would show number of asserts in addition to: | |
Executed 59 tests, with 0 failures (0 unexpected) in 0.999 (1.082) seconds | |
I wish the console would always be scrolled to the bottom and the current output (more of a general Xcode bug though). | |
I wish I didn't have to add a string to the end of every assert. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In my app I made a helper method to help me render form rows and DRY up my code. | |
def form_row(form, input_type, symbol) | |
# Need to generate HTML like this | |
# <div class="clearfix"> | |
# <%= f.label :first_name %> | |
# <div class="input"> | |
# <%= f.text_field :first_name, html_options = {:class => 'xlarge'} %> | |
# </div> | |
# </div><!-- /clearfix --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__block CompanyEditorWindowController *blockSelf = self; | |
self.kvoTokenForCompany = [self addKVOBlockForKeyPath:@"company" options:NSKeyValueObservingOptionNew handler:^(NSString *keyPath, id object, NSDictionary *change) { | |
[blockSelf updateUIBasedOnCompanyType]; | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Address Book" | |
(* set thePerson to make new person with properties {first name:"Ben", last name:"Waldie", organization:"Automated Workflows, LLC", job title:"President"} | |
save *) | |
set thePeople to selection | |
repeat with thePerson in thePeople | |
set output to formatted address of address of thePerson | |
log "hello" | |
log output | |
end repeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ImageToDataTransformer.m | |
// ProfitTrain | |
// | |
// Created by Michael Zornek on 10/4/11. | |
// Copyright (c) 2011 Clickable Bliss. All rights reserved. | |
// | |
#import "ImageToDataTransformer.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If I create an NSImage via something like: | |
NSImage *icon = [NSImage imageNamed:NSImageNameUser]; | |
it only has one representation, a NSCoreUIImageRep which seems to be a private class. | |
I'd like to archive this image as an NSData but if I ask for the TIFFRepresentation I get a | |
small icon when the real NSImage I originally made seemed to be vector and would scale up to fill my image views. | |
I was kinda hoping images made this way would have a NSPDFImageRep I could use. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error { | |
NSNumberFormatter *formatter; | |
id object = nil; | |
formatter = [[NSNumberFormatter alloc] init]; | |
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle]; | |
[formatter setGeneratesDecimalNumbers:YES]; | |
[formatter getObjectValue:&object forString:string errorDescription:error]; | |
if (object) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So I have this AddressBookCard entity. It has a BOOL attribute | |
called shouldSyncWithAddressBook. The idea being when set to YES | |
we will keep this AddressBookCard in sync with it's AddressBook | |
brother. | |
Part of the implementation for the AddressBookCard subclass of | |
NSManagedObject is some KVO for the shouldSyncWithAddressBook | |
attribute. When it is changed I check it's value and if YES I | |
instantly pull in the data from AddressBook. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @event.main_venue.blank? %> | |
<div id="behavior_form_main_venue_form" class="behavior_form hide"> | |
<% else %> | |
<div id="behavior_form_main_venue_form" class="behavior_form"> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From iCloud Core Data sample code from Apple. | |
// https://devforums.apple.com/thread/126670 | |
- (void)dealloc { | |
[managedObjectContext__ release]; | |
[managedObjectContext__ release]; | |
[managedObjectContext__ release]; | |
[recipeListController release]; | |
[tabBarController release]; |