Skip to content

Instantly share code, notes, and snippets.

@aug2uag
aug2uag / gist:8516849
Created January 20, 2014 08:39
data structure for Olu
{
"motion0_standNeutral":{
"point0":(0,0,101,405),
"point1":(0,10,101,405),
"pointx":(xOrigin, yOrigin, xWide, yHeight) },
"motion1_kneeUp":{
"point0":(34,25,214,591),
"point1":(92,39,214,591),
"pointx":(xOrigin, yOrigin, xWide, yHeight) }
}
@aug2uag
aug2uag / gist:8628532
Created January 26, 2014 04:45
Express Mongo instant
// configure API
var express = require('express')
, app = express();
var mongodb = require('mongodb');
var MongoClient = require('mongodb').MongoClient
, format = require('util').format;
MongoClient.connect('mongodb://127.0.0.1:27017/enterDbName', function(err, db) {
@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 {