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
@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]; |
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
- (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]; |
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
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 |
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
@implementation MSFilmStripPickerScrollView | |
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event | |
{ | |
return YES; | |
} | |
@end |
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
@implementation JimPopUpButtonCell | |
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView | |
{ | |
NSRect rect = [self drawingRectForBounds: cellFrame]; | |
rect.size.width -= 17; // chop off the popup indicator | |
NSSize imageSize = NSMakeSize(12, 12); | |
rect.origin.x += (rect.size.width - imageSize.width) / 2.0; |
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
- (id)copyWithZone:(NSZone *)zone | |
{ | |
RSRadialProgressCell* newbie = [super copyWithZone:zone]; | |
// When you use -[super copyWithZone], you have to assume that the superclass may have copied your instance variables over verbatim. So | |
// let's clear them out manually (using accessors would cause the stale pointer reference to be released). | |
newbie->mProgressView = nil; | |
newbie->mProgressView = [mProgressView retain]; | |
newbie->mProgressCompletedOverlayImage = nil; | |
newbie->mProgressCompletedOverlayImage = [mProgressCompletedOverlayImage retain]; |
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
// | |
// TextView.m | |
// TextDidChange | |
// | |
// Created by Timothy J. Wood on 10/27/09. | |
// Copyright 2009 The Omni Group. All rights reserved. | |
// | |
/* |
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
# Copies the selected tweet's URL from Twitter.app, and | |
# opens corresponding page for Aaron Swartz's Twitter Viewer. | |
# | |
# Original by John Gruber: https://gist.github.com/1440914 | |
# This version by Daniel Jalkut | |
# | |
# I'm hooking this up to a keyboard shortcut specifically in Twitter.app, | |
# using my scripting utility FastScripts. | |
# | |
# Requires "Access for Assistive Devices" to be enabled. |
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
#!/bin/bash | |
# run from terminal and you can watch it log as well... or nohup it | |
cd ~ | |
testSiteForChanges () | |
{ | |
ls "old_page.html" 1>/dev/null 2>/dev/null | |
if [ $? -eq "1" ] ; then | |
/usr/local/bin/wget -q -O old_page.html $1 |
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
tell application "System Events" | |
set frontProcess to first process whose frontmost is true | |
-- When it's down to just Finder and the front process, we have to switch | |
-- to the Finder first to get the front process to hide itself. Furthermore, | |
-- the Finder will not be listed as among the visible processes unless it | |
-- has open windows, so treat a condition of 2 *or fewer* visible apps as | |
-- meaning the Finder should be activated before hiding the front process. |
OlderNewer