Skip to content

Instantly share code, notes, and snippets.

View ezefranca's full-sized avatar
💻
👨🏻‍💻

Ezequiel Santos ezefranca

💻
👨🏻‍💻
View GitHub Profile
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
/*
paper beta de grafos em linguagem C by Cooler_
contato: c00f3r[at]gmail[dot]com
O que é ?
Em matemática e ciência da computação, grafo é o objeto básico de estudo da
teoria dos grafos. Tipicamente, um grafo é representado como um conjunto de
pontos (vértices) ligados por retas (as arestas). Dependendo da aplicação, as
arestas podem ser direcionadas, e são representadas por "setas".
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//full screen width table view separator
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
}
@interface Article : MTLModel <MTLJSONSerializing>
@property (nonatomic) NSString *title;
@property (nonatomic) NSString *body;
@property (nonatomic) NSURL *url;
@property (nonatmoic) NSDate *dateModified;
@implementation Article
@ezefranca
ezefranca / sharedButtonCode
Created November 9, 2015 20:54 — forked from aaronwardle/sharedButtonCode
UIActivityViewController Example
- (void)shareButtonClicked {
//-- set strings and URLs
NSString *textObject = @"Information that I want to tweet or share";
NSString *urlString = [NSString stringWithFormat:@"http://www.mygreatdomain/%@", _selectedPageString];
NSURL *url = [NSURL URLWithString:urlString];
NSArray *activityItems = [NSArray arrayWithObjects:textObject, url, nil];
//-- initialising the activity view controller
@ezefranca
ezefranca / UITableView_SeparatorLine.md
Created November 18, 2015 14:36 — forked from TonnyXu/UITableView_SeparatorLine.md
set UITableView.separatorLine to 2px and with different colors each pixel

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

@ezefranca
ezefranca / gist:4d37d8fcfce542d204be
Created December 1, 2015 17:24 — forked from paulrehkugler/gist:9647085
Default Protocol Method Implementation in Objective-C
// SomeProtocol.h
@protocol SomeProtocol <NSObject>
- (void) protocolMethod;
@end
// NSObject+SomeProtocolDefaultImplementation.h
@interface NSObject(SomeProtocolDefaultImplementation)
@interface TMObjectThatHasLotsOfDependenciesInjected : NSObject
- (nonnull instancetype)initWithDependency:(TMDependency * __nonnull)dependency
anotherDependency:(TMOtherDependency * __nonnull)anotherDependency NS_DESIGNATED_INITIALIZER;
/// option 1: break inheritance
- (nullable instancetype)init __attribute__((unavailable("Use initWithDependency:anotherDependency: instead")));
@end
@ezefranca
ezefranca / RecursiveBlock.m
Created December 1, 2015 17:25 — forked from paulrehkugler/RecursiveBlock.m
Recursive Block
// Follow up to - https://gist.github.com/paulrehkugler/11063725
BOOL baseCaseCondition = NO; // obviously this should be data driven, not hardcoded
typedef void (^RecursiveBlock)(void (^)());
RecursiveBlock aRecursiveBlock;
aRecursiveBlock = ^(RecursiveBlock block){
if ((baseCaseCondition) && block)
{