Skip to content

Instantly share code, notes, and snippets.

View oleganza's full-sized avatar

Oleg Andreev oleganza

View GitHub Profile
-----------
Please try this:
1. Quit Gitbox.
2. Delete ~/Library/Preferences/com.oleganza.gitbox.plist
3. Run in Terminal: defaults delete com.oleganza.gitbox
4. Run in Terminal: git config --global push.default matching
5. Open Gitbox.
[Author: garyrowe https://bitcointalk.org/index.php?topic=89772.msg988857#msg988857]
Your post advocates a
( ) technical ( ) legislative ( ) market-based ( ) vigilante
approach to stopping Bitcoin. Your idea will not work. Here is why it won't work. One or more of the following may apply to your particular idea, and it may have other flaws which vary from country to country due to their own legal systems:
( ) Scammers can easily use it to bilk unsuspecting consumers/merchants
( ) Merchants and other legitimate businesses would be adversely affected
Future of Bitcoin mining is specialized factories plugging chips in right after baking them.
These factories would work on the same profit margin as any other stable business.
Motivation to play honestly whould be right there: the value of produced bitcoins
is in their fungibility. Any censorship by the miners will be hurting them first.
And misbehaving miners are too easy to ostracize and drive out of business completely.
// I'd like Clang to compile this:
self.view.frame.origin.x = 0;
// Into this:
{
UIView* v = self.view;
CGRect f = [v frame];
f.origin.x = 0;
@oleganza
oleganza / bitcoin-wtf.txt
Created August 24, 2013 19:56
Some WTF moments when reading BitcoinQT source code. It's not to insult people, but to help others quickly understand why some things are done in some way.
1. CheckSig function and a dozen other pass around nHashType argument which means nothing - the nHashType is always read from the last byte of the signature. Nowhere in the code non-zero value is passed and even if it was passed, it must match the last byte.
if (nHashType == 0)
nHashType = vchSig.back();
else if (nHashType != vchSig.back())
return false;
2. OP_CODESEPARATOR cannot be meaningfully used, but we have to account for it till the end of times when computing a portion of a script for signature verification.
@oleganza
oleganza / tinkoff
Last active December 20, 2015 20:59
1. Человек А подделывает договор с человеком Б и идет к хорошо вооруженному человеку Ц
чтобы тот, доверяя подделке, отобрал деньги силой у человека Б.
2. Человек Б идет к хорошо вооруженному человеку Ц и просит не только не отбирать у него деньги,
но и затолкать человека А силой в клетку.
3. Люди X, Y и Z начинают симпатизировать человеку А и ругают человека Б за то,
что он угрожает человеку А.
4. Человек Б начинает хамить всем, кто недоволен его поведением.
If you tinkered with Info.plist trying to make your document type *actually* display your icon and open in your app, you probably fucked up your machine (restart won't help).
1. Go and remove your types from ~/Library/Preferences/com.apple.LaunchServices.plist
2. Restart LaunchServices: $ /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
3. Check if your types are removed: $ defaults read com.apple.LaunchServices LSHandlers | grep mytype
If they are not removed yet, wait a minute and check again. LS takes time to actually reload.
Clean up your Xcode build and try again. This time created file should get proper association with your app and display a right icon.
// Oleg Andreev <[email protected]>
#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.
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.
@oleganza
oleganza / gist:3404669
Created August 20, 2012 14:18
Modern Objective-C
// 2011:
[container setObject:value forKey:[NSString stringWithFormat:@"%d", number]];
// 2012:
container[@(number).stringValue] = value;