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
// Oleg Andreev <oleganza@gmail.com> | |
#import <Foundation/Foundation.h> | |
@interface NSData (BTC) | |
// Init with securely random byte string from /dev/random | |
- (id) initRandomWithLength:(NSUInteger)length; | |
// Init with zero-terminated string in UTF-8 encoding. |
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
Apr. 25 2013 15:30 CEST UPDATE | |
Dear all, we'd like to give everyone an update as to what exactly is happening, has happened, and will happen in relation to the recent events at Bitcoin-Central.net. | |
Here are a few questions that require an immediate answer. | |
Have funds been lost? | |
A few hundred Bitcoins have been stolen from our hot wallet. |
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
// 2011: | |
[container setObject:value forKey:[NSString stringWithFormat:@"%d", number]]; | |
// 2012: | |
container[@(number).stringValue] = value; |
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
#!/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 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 <oleganza@gmail.com> | |
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 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 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 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 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 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" |