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)dosomething | |
{ | |
BOOL bacon = YES; | |
// or... | |
__block BOOL bacon = YES; | |
dispatch_block_t block = ^{ | |
// do something with bacon… |
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
// | |
// UpgradeController.m | |
// Caffeinated | |
// | |
// Created by Curtis Hard on 25/07/2013. | |
// | |
// | |
#import "UpgradeController.h" |
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
NSBitmapImageRep * bitmapRep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:rect] autorelease]; | |
CIImage * im = [[[CIImage alloc] initWithBitmapImageRep:bitmapRep] autorelease]; | |
[im drawAtPoint:rect.origin | |
fromRect:NSZeroRect | |
operation:NSCompositeSourceOver | |
fraction:1.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
// this is the cure to fix the scrollers | |
- (NSView *)hitTest:(NSPoint)aPoint | |
{ | |
// CHANGE NEXT LINE TO HOW YOU CHECK FOR LION, UNLESS YOUR APP | |
// ONLY WORKS ON LION THEN JUST DELETE THE IF | |
// are we running lion? | |
if( ! IS_RUNNING_LION ) | |
{ | |
// if we are not, dont bother with the | |
return [super hitTest:aPoint]; |
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
[GGShortcutController observerScheme:SETTING_SHORTCUT_SCHEME | |
identifier:SETTING_SHORTCUT_TOGGLE_READABILITY | |
window:[view window] | |
block:^( GGShortcutContainer * container ) | |
{ | |
[self toggleReadability:nil]; | |
}]; |
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
+ (UniChar)characterForVirtualKeyCode:(NSInteger)keyCode | |
{ | |
/************** | |
THIS REQUIRES THE CARBON FRAMEWORK! | |
***************/ | |
UInt32 deadKeyState = 0; | |
UniCharCount actualCount = 0; | |
UniChar baseChar; | |
TISInputSourceRef sourceRef = TISCopyCurrentKeyboardLayoutInputSource(); | |
CFDataRef keyLayoutPtr = (CFDataRef)TISGetInputSourceProperty( sourceRef, kTISPropertyUnicodeKeyLayoutData ); |
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
// | |
// GDataController.m | |
// Caffeinated | |
// | |
// Created by Curtis Hard on 03/11/2010. | |
// Copyright (c) 2010 GeekyGoodness. All rights reserved. | |
// | |
#import "GDataController.h" |
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
$this->set_request( lib_coredata_request::factory( lib_coredata_entity::factory( 'news' ) ) | |
->set_predicate( new lib_coredata_predicate( 'status=%d', 5 ) ) ); |
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
<?php | |
class lib_coredata_predicate extends lib_coredata_properties | |
{ | |
/** | |
* | |
*/ | |
const LIB_COREDATA_FILLER_ATTRIBUTE = '%@'; |
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 NSAnimationContextRunAnimationBlock( dispatch_block_t group, dispatch_block_t completionHandler, NSTimeInterval time ) | |
{ | |
[NSAnimationContext runAnimationBlock:group | |
completionHandler:completionHandler | |
duration:time]; | |
} | |
+ (void)runAnimationBlock:(dispatch_block_t)group | |
completionHandler:(dispatch_block_t)completionHandler | |
duration:(NSTimeInterval)time |
NewerOlder