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
#import "IconCollectionItem.h" | |
@implementation IconCollectionItem | |
- (void)doubleClick:(id)sender { | |
NSLog(@"double click in the collectionItem"); | |
if([self collectionView] && [[self collectionView] delegate] && [[[self collectionView] delegate] respondsToSelector:@selector(doubleClick:)]) { | |
[[[self collectionView] delegate] performSelector:@selector(doubleClick:) withObject:self]; | |
} |
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
@interface MyViewController : NSViewController <NSCollectionViewDelegate> | |
{ | |
IBOutlet NSCollectionView *collectionView; | |
IBOutlet NSArrayController *arrayController; | |
NSMutableArray *images; | |
NSUInteger sortingMode; | |
BOOL alternateColors; | |
NSArray *savedAlternateColors; |
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
- (void)doubleClick:(id)sender { | |
NSLog(@"Double clicked on icon: %@", [[sender representedObject] valueForKey:@"name"]); | |
} |
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
# 2010, Johannes Fahrenkrug, http://springenwerk.com | |
# Run it like this: | |
# ruby script/runner clear_diskcache.rb http://mysite.com/some/page http://mysite.com/some/other/page | |
if ARGV.size < 1 | |
puts "Please supply one or more URLs!" | |
exit | |
else | |
ms = Radiant::Cache::MetaStore.new | |
ARGV.each do |url| |
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
@import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
CPWindow theWindow; //this "outlet" is connected automatically by the Cib | |
@outlet CPTextField nameTextField; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification |
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
@import <Foundation/CPObject.j> | |
@import <MapKit/MKMapView.j> | |
@import <MapKit/MKMarker.j> | |
@import <MapKit/MKLocation.j> | |
@implementation AppController : CPObject | |
{ | |
CPWindow theWindow; //this "outlet" is connected automatically by the Cib |
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
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/oigdrgh286E&hl=en_US&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/oigdrgh286E&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></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
- (void)scaleImage:(float)aScaleFactor | |
{ | |
//see: http://maettig.com/code/css/css-transform.html | |
var styleObject = [imageView imageLayer]._DOMContentsElement.style; | |
if (CPBrowserIsEngine(CPWebKitBrowserEngine) && (typeof styleObject.WebkitTransform != "undefined")) | |
{ | |
styleObject.WebkitTransform = "scale(" + aScaleFactor + ")"; | |
[[imageView imageLayer] setNeedsDisplay]; | |
} |
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 2010 by Johannes Fahrenkrug, http://springenwerk.com | |
# See you at WWDC! | |
require 'rubygems' | |
require 'open-uri' | |
class WWDC2010 | |
def self.announced? | |
title = open('http://developer.apple.com/wwdc') do |f| | |
f.detect { |line| line =~ /<title>/ } |
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
-(void)drawInContext:(CGContextRef)myContext { | |
CGContextSaveGState(myContext);// 6 | |
CGFloat potentialFlip = 1.0; | |
CGFloat shadowBlur = 4; | |
CGFloat shadowOffset = 4; | |
CGFloat shadowOffsetNeg = shadowOffset * -1.0; | |
CGFloat x = self.bounds.origin.x + shadowOffset; | |
CGFloat y = self.bounds.origin.y + shadowOffset; | |
CGFloat wd = self.bounds.size.width - (shadowOffset * 2); |