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
Verifying that +brianwilliams is my blockchain ID. https://onename.com/brianwilliams |
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 <XCTest/XCTest.h> | |
@interface XCTestCase (RLWaitWithExpectation) | |
- (void)waitFor:(NSTimeInterval)seconds withExpectationBlock:(BOOL (^)())block; | |
@end | |
@implementation XCTestCase (RLWaitWithExpectation) |
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
// | |
// RLCrashyView.m | |
// CrashyMcCrashy | |
// | |
// Created by brian on 10/31/13. | |
// Copyright (c) 2013 Rantlab. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> |
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
// | |
// RLArrowView.m | |
// | |
// Created by brian on 6/20/13. | |
// Copyright (c) 2013 RantLab. All rights reserved. | |
// | |
#import "RLArrowView.h" | |
@implementation RLArrowView |
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
- (void)wiggleFromPath:(CGPathRef)path target:(CGPoint)target amount:(CGFloat)amount | |
{ | |
CGPoint middle = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); | |
CGPathRef endPath = [RLArrowView createPathWithArrowFromPoint:middle | |
toPoint:target | |
tailWidth:2.0 | |
headWidth:10.0 | |
headLength:20.0 | |
wiggle:amount]; |
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
CGPathRef endPath = [RLArrowView createPathWithArrowFromPoint:middle | |
toPoint:target | |
tailWidth:2.0 | |
headWidth:10.0 | |
headLength:20.0 | |
wiggle:0]; | |
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ | |
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
- (void)mouseDown:(NSEvent *)event | |
{ | |
arrow = [CAShapeLayer layer]; | |
CGFloat minMagnitude = 20; | |
CGPoint middle = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); | |
CGPoint vector = CGPointMake(target.x-middle.x, target.y-middle.y); | |
CGFloat magnitude = sqrt(vector.x*vector.x+vector.y*vector.y); | |
CGPoint start = CGPointMake(middle.x+vector.x/magnitude*minMagnitude, middle.y+vector.y/magnitude*minMagnitude); | |
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
+ (CGPathRef )createPathWithArrowFromPoint:(CGPoint)startPoint | |
toPoint:(CGPoint)endPoint | |
tailWidth:(CGFloat)tailWidth | |
headWidth:(CGFloat)headWidth | |
headLength:(CGFloat)headLength | |
wiggle:(CGFloat)wiggle | |
{ | |
CGFloat length = hypotf(endPoint.x - startPoint.x, endPoint.y - startPoint.y); | |
CGPoint points[9]; |
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
// | |
// NSObject+BlockObservation.h | |
// Version 1.0 | |
// | |
// Andy Matuschak | |
// [email protected] | |
// Public domain because I love you. Let me know how you use it. | |
// | |
#import <Cocoa/Cocoa.h> |
NewerOlder