Skip to content

Instantly share code, notes, and snippets.

View aug2uag's full-sized avatar

Reza Fatahi aug2uag

  • Los Angeles, CA
View GitHub Profile
@aug2uag
aug2uag / gist:8763107
Created February 2, 2014 04:34
Incompatible block pointer types
- (BOOL)setMore
{
BOOL moreExist = NO;
if (foo || bar)
{
moreExist = YES;
[NSURLConnection sendAsynchronousRequest:[NSURLRequest
requestWithURL: [NSURL URLWithString:url]] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
@aug2uag
aug2uag / gist:9264193
Last active August 29, 2015 13:56
Core Animation Basic Example
- (void)viewDidLoad
{
UIView* sampleView = [[UIView alloc] init];
[self.view addSubview:sampleView];
sampleView.backgroundColor = [UIColor redColor];
// define center of view
CGPoint currentCenterPoint = self.view.center;
CGRect invisibleRect = CGRectMake(currentCenterPoint.x, currentCenterPoint.y, 0, 0);
@aug2uag
aug2uag / gist:9654912
Created March 20, 2014 00:36
CoreData singleton
//
// CoreDataManager.h
//
// Created by Rex Fatahi on 3/17/14.
// Copyright (c) 2014 aug2uag. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CoreDataManager : NSObject
@aug2uag
aug2uag / backbone.js
Last active August 29, 2015 14:00
Backbone.js Router config
// Backbone.js 1.1.2
// (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(root, factory) {
// Set up Backbone appropriately for the environment. Start with AMD.
@aug2uag
aug2uag / gist:5378c17c8874e5dbca10
Created May 17, 2014 08:10
demonstration that removing object from superview requires re-alloc of that object
//
// ViewController.m
// remove from superview demo
//
// Created by Rex Fatahi on 5/17/14.
// Copyright (c) 2014 aug2uag. All rights reserved.
//
#import "ViewController.h"
@aug2uag
aug2uag / gist:17a751c7c486fc3ca268
Last active August 29, 2015 14:02
Timer on NSDate
//
// ViewController.m
// gfhdsjkaryeuiw123
//
// Created by Rex Fatahi on 6/6/14.
// Copyright (c) 2014 aug2uag. All rights reserved.
//
#import "ViewController.h"
@aug2uag
aug2uag / gist:d2f6f07e8469afd153b8
Last active August 29, 2015 14:02
Gingerbreadman fractal
//
// ViewController.swift
// GingerBreadMan
//
// Created by Rex Fatahi on 6/22/14.
// Copyright (c) 2014 aug2uag. All rights reserved.
//
import UIKit
#pragma tableview datasource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
@aug2uag
aug2uag / gist:78f1066e9921452342cd
Created July 19, 2014 03:11
Cocoa random number
int randInt = arc4random() % <#number#>;
@aug2uag
aug2uag / gist:316f49755bbad689f598
Created July 19, 2014 20:47
UITableView remove additional separators
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 0.01f;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
}