Skip to content

Instantly share code, notes, and snippets.

View danielpunkass's full-sized avatar

Daniel Jalkut danielpunkass

View GitHub Profile
@implementation MSFilmStripPickerScrollView
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
return YES;
}
@end
tell application "System Events"
tell application process "BBEdit"
tell (pop up button 1 of window 1)
-- Click to make the menu appear in the hierarchy
click
-- Now select the "Go to" item...
set goToItem to menu item "Go to…" of menu 1
click goToItem
- (void) testSimpleHTTPRequest
{
RSHTTPRequest* testViaGoogleRequest = [[RSHTTPRequest alloc] initWithURL:[self serverURLForHTTPTestNamed:@"SimpleHTTPRequest"] notifyingDelegate:self];
STAssertNotNil(testViaGoogleRequest, @"Creation of HTTP Request should have succeeded.");
[testViaGoogleRequest download];
[self spinRunLoopUntilCompletionOrTimeout];
STAssertTrue([[testViaGoogleRequest responseData] isEqualTo:[@"<hello>" dataUsingEncoding:NSUTF8StringEncoding]], @"Expected <hello> result, got %@.", [testViaGoogleRequest responseData]);
[testViaGoogleRequest release];
@implementation NSImage (RSShading)
- (NSImage *) tintedImage
{
NSImage* newImage = [[[NSImage alloc] initWithSize:[self size]] autorelease];
NSRect imageRect = {NSZeroPoint, [self size]};
NSColor *color = [NSColor blackColor];
[newImage lockFocus];
[[color colorWithAlphaComponent: 0.25] set];