Skip to content

Instantly share code, notes, and snippets.

View neonichu's full-sized avatar
🤬
GitHub, cancel your contract with ICE!

Boris Bügling neonichu

🤬
GitHub, cancel your contract with ICE!
View GitHub Profile
@landonf
landonf / library_quality.md
Created April 1, 2014 21:10
An addendum to issue #1852

Social + Tool Driven Quality Control

The follow-up I wrote for CocoaPods issue #1852 covers a lot of technical ground, but I also wanted to tackle the issue from a less crash reporting-focused perspective.

While I think the technical direction is interesting, and we're exploring some of these ideas in PLCrashReporter, it's easy to lose sight of the original goal -- ensuring that CocoaPod users can introduce library dependencies without concern that there are significant regressions in a given library or release.

In this area, I think that social and tool-driven hints are not only cheaper to implement, but would be just as powerful -- if not more so -- than a complex crash reporting system that can only find issues after they've already shipped.

If you look at automated build and dependency tooling on other platforms (in particular, I have Maven since that's what I'm familiar with, but these notions are hardly unique to the JVM language family),

- (void)testSparkInspectorCompatibility {
PSPDFDocument *document = [[PSPDFTestAssetLoader new] documentWithName:@"Testcase_Metadata.pdf"];
// Spark swizzles this method and calls description on the target. Let's simulate this for this test case, and then clean up.
id<Aspect> token = [NSNotificationCenter aspect_hookSelector:@selector(addObserver:selector:name:object:) withOptions:0 usingBlock:^(id instance, NSArray *args) {
[args.firstObject description];
} error:NULL];
// Load the document. This failed because of side effects in description when called during init.
UIImage *image = [document imageForPage:0 size:CGSizeMake(100, 100) clippedToRect:CGRectZero annotations:nil options:nil receipt:NULL error:NULL];
@orta
orta / Mocta.md
Last active August 29, 2015 14:01
Mocks & Stubs in a Specta / Expecta world

Getting a Mocta object

NSUserDefaults<Mocta> *defaults = [Mocta objectWithClass:[NSUserDefaults class]];
id< UITableViewDelegate, MoctaStub> delegate = [Mocta objectWithProtocol:@protocol(UITableViewDelegate)];

Expectations

Expectations are ran on dealloc, or at the end of the test case, so I don't have to do it manually.

@kylef
kylef / Mocta.md
Last active August 29, 2015 14:01 — forked from orta/Mocta.md

Getting a Mocta object

NSUserDefaults<Mocta> *defaults = [Mocta objectWithClass:[NSUserDefaults class]];
id< UITableViewDelegate , MoctaStub> delegate = [Mocta objectWithProtocol:@protocol(UITableViewDelegate)];

Expectations

Expectations are ran on dealloc, so I don't have to do it manually.

@wessmith
wessmith / pod-install-post-checkout.sh
Last active August 29, 2015 14:01
pod install post-checkout script
#!/bin/bash
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
if [[ $BRANCH_SWITCH == "1" && $PREVIOUS_HEAD != $NEW_HEAD ]]; then
# Kill the simulator.
SIM=`pgrep 'iPhone Simulator'`
#import <Foundation/Foundation.h>
NSDictionary *TestD(void) {
return @{
@"string" : @"abc",
@"number" : @42,
@"dictionary" : @{
@"string" : @"abcdef",
@"array" : @[ @"a", @2 ]
},
import Darwin
// Swift hates uninitialized values but we need to create stuff without
// an explicit initial value. This protocol is for anything that can be
// created with any sort of default value (e.g. all integer types init
// with zero.
protocol Initable {
init()
int invoke_fun(int (*f)(void));
@jonstorer
jonstorer / xcode.rake
Created October 14, 2014 15:14
Install & Use Xcode 5.1
namespace :xcode do
desc 'install xcode'
task :install => [:download, :mount, :link]
task :download do
# Whatever version you'd like
execute 'curl -o ~/Downloads/Xcode.dmg https://s3.amazonaws.com/[insert-your-bucket-here]/xcode_5.1.1.dmg'
end
task :mount do
@alloy
alloy / gist:ee4d30d9b64f72229b0f
Last active August 29, 2015 14:08
VirtualBox OS X images for package installation purposes.
  • Create bootable installer image with https://ntk.me/2012/09/07/os-x-on-os-x/:
    • $ [sudo] gem install iesd
    • $ iesd -i '/path/to/Install OS X Yosemite.app’ -o /path/to/boot-image.dmg
    • If low on disk space, be sure to prepend: $ env TMPDIR=/path/to/disk/with/space/tmp iesd …
  • Install VM:
    • Place HD image inside dir with other VM files
    • Format HD with name of OS, e.g. Yosemite
  • Reduce used disk space with http://apple.stackexchange.com/a/48922:
    • Remove localisation files with Monolingual
  • Remove /System/Library/Speech/Voices/*