Skip to content

Instantly share code, notes, and snippets.

View bananita's full-sized avatar

Michał Banasiak bananita

  • so many apps
  • Poland
View GitHub Profile
# OS X temporary files
.DS_Store
*.swp
*.lock
profile
# XCode user data
xcuserdata
# Cocoapods
# OS X temporary files
.DS_Store
*.swp
*.lock
profile
# Compiled classes
*class
*dex
gem "cocoapods", "~> 0.19.1"
platform :ios, '6.0'
inhibit_all_warnings!
pod 'ObjectiveSugar'
pod 'MBLogging', :git => 'https://github.com/bananita/MBLogging.git', :tag => '0.1.0'
target :tests, :exclusive => true do
pod 'OCMock'
end
@bananita
bananita / ApplicationContext.h
Last active December 19, 2015 19:09
Cocoa singletons wrapped in one class to allow mocking them.
//
// ApplicationContext.h
//
// Created by Michał Banasiak on 22.07.2013.
// Copyright (c) 2013 Michał Banasiak. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ApplicationContext : NSObject
@bananita
bananita / AvailableFonts
Last active December 26, 2015 12:49
Snippet that shows all available fonts.
NSArray *fontFamilyNames = [UIFont familyNames];
for (NSString *familyName in fontFamilyNames)
{
NSLog(@"Font Family Name: %@", familyName);
NSArray *names = [UIFont fontNamesForFamilyName:familyName];
NSLog(@"Font Names:\n %@", names);
}
render text: Kramdown::Document.new(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s).to_html
GitHub::Markdown.render_gfm(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s)
CodeRay.scan(GitHub::Markdown.render_gfm(Base64.decode64 Octokit.readme('bananita/mbfaker').content.to_s), :objc).div(:line_numbers => :table)
@bananita
bananita / How to convert *app to *ipa
Created December 19, 2013 13:23
How to convert *app to *ipa
1. Create a folder called Payload
2. Place the .app folder inside of that
3. Zip up the Payload folder using normal compression
4. Then rename the file with a .ipa extension
@bananita
bananita / gist:8652005
Created January 27, 2014 16:36
gist submodules refreshing
git pull && git submodule init && git submodule update && git submodule status
@implementation ChildManagedObjectContext
- (BOOL)save:(NSError *__autoreleasing *)error
{
NSError* superError;
BOOL superResult = [super save:&superError];
if (!superResult) {
*error = superError;
return NO;