Skip to content

Instantly share code, notes, and snippets.

View aceontech's full-sized avatar

Alex Manarpies aceontech

View GitHub Profile
@aceontech
aceontech / NSHTTPCookieStorage+Util.h
Created February 25, 2014 15:05
Utility category for deleting all cookies from a given domain.
//
// Created by Alex Manarpies on 25/02/14.
//
@interface NSHTTPCookieStorage (Util)
/**
* Iterates over all cookies for a given a domain and deletes them from the cookie store.
*/
- (void)util_deleteCookiesForURL:(NSURL*)url;
@aceontech
aceontech / CoreDataInMemorySetupExampleSpec.m
Created February 7, 2014 10:04
Setting up an in-memory Core Data stack for unit testing. This example uses Specta, but can be easily be adapted for XCTest.
#import <Specta.h>
#define EXP_SHORTHAND
#import <Expecta.h>
#import <CoreData/CoreData.h>
SpecBegin(CoreDataInMemorySetupExample)
__block NSManagedObjectContext *context;
beforeAll(^{
// ObjectModel from any models in app bundle
@aceontech
aceontech / AFNetworkReachabilityManager+RAC.h
Last active August 29, 2015 13:56
Adds support for ReactiveCocoa (RAC) to AFNetworkReachabilityManager.
// Copyright (c) 2014 Alex Manarpies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
@aceontech
aceontech / RACSerialScheduler.m
Last active August 29, 2015 13:56
ReactiveCocoa: How to initialize a RACScheduler with a serially executing GCD queue.
@interface SerialScheduler ()
@property (nonatomic, strong) RACScheduler *serialScheduler;
@end
@implementation SerialScheduler
/**
* This scheduler executes signals one a 1-by-1 basis.
* Use it with ReactiveCocoa when you want to handle signal execution serially.
*/