Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃

Leonardo CavalcanteLeo

🙃
View GitHub Profile
View css-not.scss
.nav-tab {
...
// instead of putting it on
border-right: 1px solid #424242;
&:last-child {
border-right: 0; // and then taking it off
}
// use CSS not() to only apply to the elements you want
&:not(:last-child) {
border-right: 1px solid #424242;
View FindMissingPreferredStatusBarStyle.sh
find . -type f \( -name '*ViewController.m' -or -name '*ViewController.swift' \) -exec grep -L -e 'preferredStatusBarStyle' {} +
@CavalcanteLeo
CavalcanteLeo / LocationHelper.m
Created Mar 22, 2016 — forked from chrishulbert/LocationHelper.m
Blocks location helper for finding a very rough location on an iphone
View LocationHelper.m
//
// LocationHelper.m
//
// Created by Chris Hulbert on 24/04/12.
//
#import "LocationHelper.h"
@interface LocationHelper()
@property(copy) LocationBlock locationBlock;
@CavalcanteLeo
CavalcanteLeo / LocationHelper.h
Created Mar 22, 2016 — forked from chrishulbert/LocationHelper.h
Blocks location helper for finding a very rough location on an iphone
View LocationHelper.h
//
// LocationHelper.h
//
// Created by Chris Hulbert on 24/04/12.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#define locationHelperPurpose @"This app would like to know your location for some good reason." // Change this!
View UIHelperColors.m
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
@interface FTUIHelper : NSObject
+ (UIImage *)createImageFromColor:(UIColor *)color;
+ (UIColor *)colorFromHexRGB:(NSString *)inColorString
@end
View JBSpotifyLoginViewController.h
//
// JBSpotifyLoginViewController.h
// JukeBox
//
// Created by Andrei on 9/2/13.
// Copyright (c) 2013 andreipatru. All rights reserved.
//
#import "SPLoginViewController.h"
View CoreDataHelper.m
//
// CoreDataHelper.m
// Wired In
//
// Created by Caleb Hicks on 6/20/14.
//
// Readme: I use a version of this file in each Core Data project I create. It runs as a Shared Instance.
// Simply, it returns the default Managed Object Context for the app. Sample methods also provided to save, create sample
// data, and log all data within the app. Adjust the Imports and related methods for your model objects.
//
@CavalcanteLeo
CavalcanteLeo / Directory.h
Created Mar 22, 2016 — forked from flipjorge/Directory.h
iOS Directories paths helper
View Directory.h
#import <Foundation/Foundation.h>
@interface Directory : NSObject
+(NSString*)documents;
+(NSString*)temp;
+(NSString*)library;
+(NSString*)bundle;
+(NSString*)cache;
+(NSString*)preferences;
View DictionaryTypesHelper.m
// DictionaryTypesHelper.h
#import <Foundation/Foundation.h>
@interface NSDictionary (NSDictionary_DictionaryTypesHelper)
- (NSArray*)arrayForKey:(id)key;
- (NSDictionary*)dictionaryForKey:(id)key;
- (NSString*)stringForKey:(id)key;
- (NSNumber*)numberForKey:(id)key;
- (NSData*)dataForKey:(id)key;
@CavalcanteLeo
CavalcanteLeo / taskHelper.m
Created Mar 22, 2016 — forked from craigrbruce/taskHelper.m
Helper class in obj-c to encapsulate bg tasks
View taskHelper.m
@implementation taskHelper {
}
+ (void)runTaskInBackground:(void (^)())backgroundTask
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), backgroundTask);
}
+ (void)runTaskInForeground:(void (^)())foregroundTask