git-up/GitUp 9653
The Git interface you've been missing all your life has finally arrived.
lucasderraugh/AppleProg-Cocoa-Tutorials 130
Cocoa tutorials from YouTube
lucasderraugh/AppleProg-ObjC-Tutorials 29
Objective-C tutorials from YouTube
lucasderraugh/AppleProg-Debugging-Tutorials 12
Apple Debugging tutorials from YouTube
lucasderraugh/AppleProg-C-Tutorials 11
C tutorials from YouTube
lucasderraugh/AppleProg-CocoaConcurrency-Tutorials 11
Cocoa Concurrency tutorials from YouTube (Swift+Obj-C)
lucasderraugh/AppleProg-CoreAnimation-Tutorials 11
Core Animation tutorials from YouTube
Digital logic designer and simulator
lucasderraugh/AppleProg-BuildIt 5
AppleProgramming Built It series
A simple custom slider for Mac OS 10.10+
Pull request review commentCalthings/iOS_DFU_Library
IOS-4703: Fix compilation of DFU Library with iOS SDK 15
internal class SecureDFUPacket: DFUCharacteristic { if #available(iOS 9.0, macOS 10.12, *) { // Level changes to iOS DFU framework: Make the packet size the first word-aligned value that's less than the maximum- packetSize = UInt32(characteristic.service.peripheral.maximumWriteValueLength(for: .withoutResponse)) & 0xFFFC+ packetSize = UInt32(characteristic.service?.peripheral?.maximumWriteValueLength(for: .withoutResponse) ?? 0) & 0xFFFC
I'm not sure we should use 0 here. Will this work?
if #available(iOS 9.0, macOS 10.12, *), let peripheral = characteristic.service?.peripheral {
// Level changes to iOS DFU framework: Make the packet size the first word-aligned value that's less than the maximum
packetSize = UInt32(peripheral.maximumWriteValueLength(for: .withoutResponse)) & 0xFFFC
comment created time in 2 days
startedmattt/OpenAI
started time in 2 days
PR opened Calthings/iOS_DFU_Library
pr created time in 2 days
create barnchCalthings/iOS_DFU_Library
branch : ssavic/IOS-4703-Fix-compilation-of-DFU-Library-with-iOS-SDK-15
created branch time in 2 days
PR opened git-up/GitUp
yes
pr created time in 3 days
startedmattt/OpenAI
started time in 3 days
startedlucasderraugh/AppleProg-Cocoa-Tutorials
started time in 4 days
Pull request review commentgit-up/GitUp
- (void)_reloadDeltas { GCDiffPatch* patch = [self.repository makePatchForDiffDelta:delta isBinary:&isBinary error:&error]; if (patch) { XLOG_DEBUG_CHECK(!isBinary || patch.empty);- if (patch.empty) {++ BOOL isImage = [[NSImage alloc] initWithContentsOfFile:[self.repository absolutePathForFile:delta.canonicalPath]] != nil;
Sorted! bae1fc2d943165e92308ef3d57e030c3abd54e96
comment created time in 6 days
startedjslegendre/MachXPC
started time in 7 days
startedgoogleprojectzero/p0tools
started time in 8 days
Pull request review commentgit-up/GitUp
+#if !__has_feature(objc_arc)+#error This file requires ARC+#endif++#import "GIPrivate.h"+#import "GILaunchServicesLocator.h"+#import <QuartzCore/CATransaction.h>++#define kImageInset 10+#define kBorderWidth 8+#define kDividerWidth 2++@interface GIImageDiffView ()+@property(nonatomic, strong) NSPanGestureRecognizer* panGestureRecognizer;+@property(nonatomic, strong) NSClickGestureRecognizer* clickGestureRecognizer;+@property(nonatomic, strong) GCLiveRepository* repository;+@property(nonatomic, strong) NSImageView* oldImageView;+@property(nonatomic, strong) NSImageView* currentImageView;+@property(nonatomic, strong) CALayer* oldImageMaskLayer;+@property(nonatomic, strong) CALayer* currentImageMaskLayer;+@property(nonatomic, strong) CALayer* oldImageBorderLayer;+@property(nonatomic, strong) CALayer* currentImageBorderLayer;+@property(nonatomic, strong) NSView* dividerView;+@property(nonatomic, strong) CALayer* transparencyCheckerboardLayer;+@property(nonatomic, strong) NSColor* checkerboardColor;+@property(nonatomic) CGFloat percentage;+@end++@implementation GIImageDiffView+- (id)initWithRepository:(GCLiveRepository*)repository {+ self = [super initWithFrame:CGRectZero];+ self.repository = repository;+ _percentage = 0.5;+ [self setupView];+ return self;+}++- (void)setupView {+ self.wantsLayer = true;++ _oldImageBorderLayer = [[CALayer alloc] init];+ _currentImageBorderLayer = [[CALayer alloc] init];+ [self.layer addSublayer:_oldImageBorderLayer];+ [self.layer addSublayer:_currentImageBorderLayer];++ _transparencyCheckerboardLayer = [[CALayer alloc] init];+ NSBundle* bundle = NSBundle.gitUpKitBundle;+ NSImage* patternImage = [bundle imageForResource:@"background_pattern"];+ _checkerboardColor = [NSColor colorWithPatternImage:patternImage];+ _transparencyCheckerboardLayer.backgroundColor = _checkerboardColor.CGColor;+ [self.layer addSublayer:_transparencyCheckerboardLayer];++ _currentImageView = [[NSImageView alloc] init];+ _oldImageView = [[NSImageView alloc] init];+ [self addSubview:_currentImageView];+ [self addSubview:_oldImageView];++ _oldImageMaskLayer = [[CALayer alloc] init];+ _oldImageMaskLayer.backgroundColor = NSColor.blackColor.CGColor;+ _oldImageView.wantsLayer = true;+ _oldImageView.layer.mask = _oldImageMaskLayer;++ _currentImageMaskLayer = [[CALayer alloc] init];+ _currentImageMaskLayer.backgroundColor = NSColor.blackColor.CGColor;+ _currentImageView.wantsLayer = true;+ _currentImageView.layer.mask = _currentImageMaskLayer;++ _dividerView = [[NSView alloc] init];+ [self addSubview:_dividerView];++ _panGestureRecognizer = [[NSPanGestureRecognizer alloc] initWithTarget:self action:@selector(didMoveSplit:)];+ _clickGestureRecognizer = [[NSClickGestureRecognizer alloc] initWithTarget:self action:@selector(didMoveSplit:)];+ [self addGestureRecognizer:_panGestureRecognizer];+ [self addGestureRecognizer:_clickGestureRecognizer];+}++- (void)setDelta:(GCDiffDelta*)delta {+ if (delta != _delta) {+ _delta = delta;+ [self updateCurrentImage];+ [self updateOldImage];+ self.percentage = 0.5;+ }+}++- (void)setPercentage:(CGFloat)percentage {+ _percentage = percentage;+ [self setNeedsDisplay:true];+}++- (void)updateCurrentImage {+ NSError* error;+ NSString* newPath;+ if (_delta.newFile.SHA1 != nil) {+ newPath = [GILaunchServicesLocator.diffTemporaryDirectoryPath stringByAppendingPathComponent:_delta.newFile.SHA1];+ NSString* newExtension = _delta.newFile.path.pathExtension;+ if (newExtension.length) {+ newPath = [newPath stringByAppendingPathExtension:newExtension];+ }+ if (![[NSFileManager defaultManager] fileExistsAtPath:newPath]) {+ [self.repository exportBlobWithSHA1:_delta.newFile.SHA1 toPath:newPath error:&error];+ }+ } else {+ newPath = [self.repository absolutePathForFile:_delta.canonicalPath];+ }+ _currentImageView.image = [[NSImage alloc] initWithContentsOfFile:newPath];
With regards to separating out image loading and size calculations: Does that mean you would want to make the cells a static height?
Right now we load the new images on setDelta and then query their dimensions during the sizing calculations to make sure they aren't scaled improperly and the aspect ratios make sense.
So the only way I could think of to avoid this reliance on in-memory images would be to set an arbitrary height and then cram the images into that space whenever they are ready 🤔
comment created time in 8 days
Pull request review commentgit-up/GitUp
+#if !__has_feature(objc_arc)+#error This file requires ARC+#endif++#import "GIPrivate.h"+#import "GILaunchServicesLocator.h"+#import <QuartzCore/CATransaction.h>++#define kImageInset 10+#define kBorderWidth 8+#define kDividerWidth 2++@interface GIImageDiffView ()+@property(nonatomic, strong) NSPanGestureRecognizer* panGestureRecognizer;+@property(nonatomic, strong) NSClickGestureRecognizer* clickGestureRecognizer;+@property(nonatomic, strong) GCLiveRepository* repository;+@property(nonatomic, strong) NSImageView* oldImageView;+@property(nonatomic, strong) NSImageView* currentImageView;+@property(nonatomic, strong) CALayer* oldImageMaskLayer;+@property(nonatomic, strong) CALayer* currentImageMaskLayer;+@property(nonatomic, strong) CALayer* oldImageBorderLayer;+@property(nonatomic, strong) CALayer* currentImageBorderLayer;+@property(nonatomic, strong) NSView* dividerView;+@property(nonatomic, strong) CALayer* transparencyCheckerboardLayer;+@property(nonatomic, strong) NSColor* checkerboardColor;+@property(nonatomic) CGFloat percentage;+@end++@implementation GIImageDiffView+- (id)initWithRepository:(GCLiveRepository*)repository {+ self = [super initWithFrame:CGRectZero];+ self.repository = repository;+ _percentage = 0.5;+ [self setupView];+ return self;+}++- (void)setupView {+ self.wantsLayer = true;++ _oldImageBorderLayer = [[CALayer alloc] init];+ _currentImageBorderLayer = [[CALayer alloc] init];+ [self.layer addSublayer:_oldImageBorderLayer];+ [self.layer addSublayer:_currentImageBorderLayer];++ _transparencyCheckerboardLayer = [[CALayer alloc] init];+ NSBundle* bundle = NSBundle.gitUpKitBundle;+ NSImage* patternImage = [bundle imageForResource:@"background_pattern"];+ _checkerboardColor = [NSColor colorWithPatternImage:patternImage];+ _transparencyCheckerboardLayer.backgroundColor = _checkerboardColor.CGColor;+ [self.layer addSublayer:_transparencyCheckerboardLayer];++ _currentImageView = [[NSImageView alloc] init];+ _oldImageView = [[NSImageView alloc] init];+ [self addSubview:_currentImageView];+ [self addSubview:_oldImageView];++ _oldImageMaskLayer = [[CALayer alloc] init];+ _oldImageMaskLayer.backgroundColor = NSColor.blackColor.CGColor;+ _oldImageView.wantsLayer = true;+ _oldImageView.layer.mask = _oldImageMaskLayer;++ _currentImageMaskLayer = [[CALayer alloc] init];+ _currentImageMaskLayer.backgroundColor = NSColor.blackColor.CGColor;+ _currentImageView.wantsLayer = true;+ _currentImageView.layer.mask = _currentImageMaskLayer;++ _dividerView = [[NSView alloc] init];+ [self addSubview:_dividerView];++ _panGestureRecognizer = [[NSPanGestureRecognizer alloc] initWithTarget:self action:@selector(didMoveSplit:)];+ _clickGestureRecognizer = [[NSClickGestureRecognizer alloc] initWithTarget:self action:@selector(didMoveSplit:)];+ [self addGestureRecognizer:_panGestureRecognizer];+ [self addGestureRecognizer:_clickGestureRecognizer];+}++- (void)setDelta:(GCDiffDelta*)delta {+ if (delta != _delta) {+ _delta = delta;+ [self updateCurrentImage];+ [self updateOldImage];+ self.percentage = 0.5;+ }+}++- (void)setPercentage:(CGFloat)percentage {+ _percentage = percentage;+ [self setNeedsDisplay:true];+}++- (void)updateCurrentImage {+ NSError* error;+ NSString* newPath;+ if (_delta.newFile.SHA1 != nil) {+ newPath = [GILaunchServicesLocator.diffTemporaryDirectoryPath stringByAppendingPathComponent:_delta.newFile.SHA1];+ NSString* newExtension = _delta.newFile.path.pathExtension;+ if (newExtension.length) {+ newPath = [newPath stringByAppendingPathExtension:newExtension];+ }+ if (![[NSFileManager defaultManager] fileExistsAtPath:newPath]) {+ [self.repository exportBlobWithSHA1:_delta.newFile.SHA1 toPath:newPath error:&error];+ }+ } else {+ newPath = [self.repository absolutePathForFile:_delta.canonicalPath];+ }+ _currentImageView.image = [[NSImage alloc] initWithContentsOfFile:newPath];
Yeah, limiting the size in memory definitely sounds advisable! I took care of that in 991f88908737795da132a25a4a2fef40e01c0364. For now I simply used a somewhat arbitrary maximum image dimension of 4000 pixels, because it was easy to do and seemed like a reasonable limit. If you think we should change this value or even make it scale dynamically by screen size or something like that let me know 🙂
comment created time in 8 days
Pull request review commentgit-up/GitUp
- (void)_reloadDeltas { GCDiffPatch* patch = [self.repository makePatchForDiffDelta:delta isBinary:&isBinary error:&error]; if (patch) { XLOG_DEBUG_CHECK(!isBinary || patch.empty);- if (patch.empty) {++ BOOL isImage = [[NSImage alloc] initWithContentsOfFile:[self.repository absolutePathForFile:delta.canonicalPath]] != nil;
Great point! I switched it over to using UTIs, which should be very fast and still plenty reliable 🙂 (c4f52a4fbc19dd030341c6b220c7bf75d31b5216)
I'm not super familiar with memory management bridging for core foundation entities, though, so that part could definitely use a thorough look 😅 (the same goes for my other fix).
comment created time in 8 days
startedsteventroughtonsmith/advancedcatalystexample
started time in 9 days
startedlucasderraugh/AppleProg-Cocoa-Tutorials
started time in 9 days
startedcemolcay/MusicTheory
started time in 11 days
startednocodb/nocodb
started time in 13 days
pull request commentgit-up/GitUp
Looking forward to this feature! Looks great!
comment created time in 13 days
startedmacshome/The-Wisdom-of-Quinn
started time in 18 days
pull request commentgit-up/GitUp
To use libgit2 as generated project, we have to solve several tasks.
- Add an option ( custom file path ) to a library.
- Figure out how to add xcframeworks to a library.
- Fix AddressSanitizer issue.
- Fix linking issues if needed. ( Security.framework is not linked well ).
comment created time in 19 days