This file contains 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
ignore_access_control_helper.rb: | |
shared_examples_for "IgnoreAccessControl" do | |
before(:each) do | |
controller.stub!(:current_user).and_return(mock(:has_role? => true)) | |
end | |
end | |
users_controller_spec.rb: |
This file contains 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: | |
// http://www.stone.com/The_Cocoa_Files/Thanks_A_Bundle_.html | |
// here's how we determine the size of the actual image in the ImageView: | |
// I reused this code from PhotoToWeb, since it worked already! | |
- (float)photoReduction { | |
NSSize size = [[self image] size]; | |
NSRect iFrame = [self bounds]; | |
if (NSWidth(iFrame) > size.width && NSHeight(iFrame) > size.height) return 1.0; // it fits |
This file contains 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
Starts with prototype in header: | |
void* _CalcImageBlobParam( | |
void *pBlob, | |
PERFECTLYCLEARCALLBACK callbackfn = NULL, | |
void *pUserData = NULL | |
); | |
Modified for use in Objective-C: |
This file contains 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
# | |
# Monkey patch for "options_for_select", which forces a title attribute on the option which is the same as the text | |
# value which will be displayed in the select box. | |
# | |
# For what purpose, you ask? Well, it's like this. Selects have fixed widths and cannot be made to expand to fill | |
# available space :-p so you must choose a width when creating it, and hope for the best. If the data to be | |
# displayed in the select is too wide, then you just can't see the whole thing. With this patch, you will at least | |
# have access to the entire string as as hover-text, using the title attribute. | |
# | |
# If you don't like this, then just delete this file from the plugin, and you will be back to normal. |
NewerOlder