This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
NSImage *computerImage = [NSImage imageNamed:NSImageNameComputer]; | |
NSInteger size = 256; | |
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] | |
initWithBitmapDataPlanes:NULL | |
pixelsWide:size | |
pixelsHigh:size | |
bitsPerSample:8 | |
samplesPerPixel:4 | |
hasAlpha:YES |
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
NSUInteger PSPDFHashFromCGRect(CGRect rect) { | |
return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height); | |
} |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#import <Foundation/Foundation.h> | |
// This helps deal with NSPointerArray that stores pointers to objects that inherit from NSObject. | |
// Not sure if this will work for other pointer types!! | |
@interface NSPointerArray (Helpers) | |
/** | |
* Adds pointer to the given object to the array. | |
* | |
* @param object Object whose pointer needs to be added to the array. |
// The correct implementation of `Equatable` (and `Comparable`) can be tricky for class | |
// hierarchies. To make it easier, it is better to follow a well-defined pattern. Here | |
// is my suggestion on how to do it: | |
// 1. Define a protocol for polymorphic test function for equality (or comparison): | |
// Note: operators are not polymorphic (not virtual in C++ terms)). The function to | |
// call is determined and hard-coded at compile time. | |
/// A protocol to ammend `Equatable` for use with `class` types. |
- (void)testMethodExpectingNoError | |
{ | |
id someObject = [self someMethodThatReturnsAnExpectedObject]; | |
id mockDependencuy = OCMClassMock([DependencyToBeMocked class]); | |
OCMStub([mockDependency someMethodWithErrorRef:[OCMArg anyObjectRef]).andReturn(someObject); | |
NSError * error = nil; | |
id someReturnedValue =[self.objectUnderTest someMethodWithErrorRef:&error]: | |
XCTAssertNotNil(someReturnedValue); |
My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...
Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they