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
#!/usr/bin/env ruby | |
# | |
# Script outputs OPML ready to be uploaded to Google Reader or a RSS app. | |
# Run in Terminal: $ ruby rss-to-opml.rb > myfeeds.opml | |
# In Google Reader, go to Settings ("gear button") -> Import/Export -> Upload OPML. | |
# Enjoy. | |
# | |
# Oleg Andreev, July 31, 2012. | |
require 'CGI' |
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
/* | |
Oleg Andreev <[email protected]> | |
January 25, 2011 | |
With NSNotificationCenter you post notifications with a name like MyNotification. | |
Observer subscribes to this name with some selector like myNotification: | |
To make things easier and less verbose, we won't declare notification names, but only the selectors. |
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
// Author: Oleg Andreev <[email protected]> | |
// May 28, 2011 | |
// Do What The Fuck You Want Public License <http://www.wtfpl.net> | |
#import "NSData+OADataHelpers.h" | |
#if !__has_feature(objc_arc) | |
#error ARC must be enabled! | |
#endif |
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
NSEvent* pingEvent = [NSEvent otherEventWithType:NSApplicationDefined | |
location:NSMakePoint(0, 0) | |
modifierFlags:0 | |
timestamp:0 | |
windowNumber:0 | |
context:nil | |
subtype:0 | |
data1:0 | |
data2:0]; |
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
// Returns a new block which calls first and second blocks | |
void(^OABlockConcat(void(^block1)(), void(^block2)()))() | |
{ | |
block1 = [[block1 copy] autorelease]; | |
block2 = [[block2 copy] autorelease]; | |
if (!block1) return block2; | |
if (!block2) return block1; | |
void(^block3)() = ^{ |
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 GBStageShortcutHintDetector : NSObject | |
+ (GBStageShortcutHintDetector*) detectorWithView:(NSView*)aView; | |
// A view which should be hidden by default and shown with a tip | |
@property(nonatomic, retain) NSView* view; | |
// A callback from the similar delegate |
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
Piotr Petrus | |
And by God, I’ve been waiting for an app like this for ages. | |
@FrogBawt | |
Gitbox — Git version control on the Mac - Now this is just sexy, why must Mac users mock me like this? | |
@brennannovak: | |
GitBox finally a glorious Gui Mac app for managing git repositories http://gitboxapp.com thank the lord! | |
http://news.ycombinator.com/user?id=makeramen: |
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
def a | |
begin | |
yield | |
rescue Exception => e | |
puts "a: rescue => #{e}" | |
else | |
puts "a: no exception" | |
ensure | |
puts "a: ensure" |
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 "NSData+OADataHelpers.h" | |
@implementation NSData (OADataHelpers) | |
- (NSString*) UTF8String | |
{ | |
return [[[NSString alloc] initWithData:[self dataByHealingUTF8Stream] encoding:NSUTF8StringEncoding] autorelease]; | |
} | |
// Replaces all broken sequences by � character and returns NSData with valid UTF-8 bytes. |
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
def go_shopping | |
buy_gloves do | |
buy_shoes do | |
buy_coat do | |
yield | |
end | |
end | |
eat_sandwitch do # in parallel to buying shoes | |
drink_coke do | |
yield |