create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
Now API looks like this: | |
- (void)getTapPoints; | |
- (void)spendTapPoints; | |
Here is how it would be absolutely awesome: | |
- (void)getTapPointsCompletion:(void (^)(TapjoyConnect *tj, NSUInteger tapPoints, NSError *error))completionBlock; | |
- (void)spendTapPoints:100 completion:(void (^)(TapjoyConnect *tj, NSError *error))completionBlock; | |
So, I could use it like this: | |
.. code .. |
// example: [self colorizeStack:self.view]; | |
- (void)colorizeStack:(UIView *)view { | |
CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0 | |
CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white | |
CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black | |
UIColor *color = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:0.8]; | |
view.backgroundColor = color; | |
for (UIView *subView in view.subviews) { |
@interface MultilineLabel : UILabel | |
@property (nonatomic) CGFloat maximumWidth; | |
@end | |
@implementation MultilineLabel | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
_maximumWidth = 200; |
self.currentItem = item; | |
RACSignal *itemChanged = [[RACObserve(self, currentItem) skip:1] take:1]; | |
// prepare item until switched to other item | |
RACSignal *itemReady = [[item rac_prepareItem] takeUntil:itemChanged]; | |
// show description if preparation takes more than 1 second | |
[[[[[RACSignal interval:1.] take:1] | |
takeUntil:itemReady] | |
deliverOn:[RACScheduler mainThreadScheduler]] |
#define IS_7_0 (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) | |
#define IS_PAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define IS_PHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f) | |
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
#ifdef DEBUG | |
# define LOG_MESSAGE(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
// Created by Roman Baulin on 17.05.2012 | |
#target photoshop | |
// in case we double clicked the file | |
app.bringToFront(); | |
var doc = app.activeDocument; | |
var startState = doc.activeHistoryState; // save for undo | |
var initialPrefs = app.preferences.rulerUnits; // will restore at end |
/* | |
File: UIImage+ImageEffects.h | |
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. | |
Version: 1.0 | |
Copyright (C) 2013 Apple Inc. All Rights Reserved. | |
*/ | |
@import UIKit; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
# | |
# (c) Baulin Roman 2015 | |
# | |
# http://stackoverflow.com/questions/1247125/how-to-get-sinatra-to-auto-reload-the-file-after-each-change | |
# https://github.com/rtomayko/shotgun | |
# sse http://www.w3schools.com/html/html5_serversentevents.asp | |
# sse with sinatra http://stackoverflow.com/questions/5227431/html5-server-sent-events-with-ruby-sinatra | |
# cool demo https://gist.github.com/rkh/1476463 | |
# |
// crash and exceptions in google analytics are stripped and all wrong | |
// but action and label can be delivered in full length | |
// | |
// send formatted string w/o params in action (as unique error name) | |
// will show up count in realtime dashboard under category err | |
// | |
// send formatted string w/ params in label (as error description) | |
// can be inspected and queryied in behaviour -> events -> overview -> err | |
// | |
// sample: TRACK_ERR(@"audiosession error %@", error) |