Skip to content

Instantly share code, notes, and snippets.

View wethu's full-sized avatar

Ellis wethu

  • Ellis Gray
  • Gold Coast
View GitHub Profile
@wethu
wethu / helper.rb
Created September 28, 2014 13:44
def form_for_login(&block)
form_for(resource,
:as => resource_name,
:url => session_path(resource_name),
:html => {
:class => 'navbar-form navbar-right',
:role => 'login'}) do block
yield
end
end
@wethu
wethu / House.rb
Last active August 29, 2015 14:07
class House < ActiveRecord::Base
has_many :house_classes
has_many :students, :through => :house_classes
has_many :referrals
has_one :hoh
end
Oct 8 15:18:47 MacbookPro fontd[260]: BUG in libdispatch client: dispatch_mig_server: mach_msg() failed (ipc/send) invalid memory - 0x1000000c
Oct 8 15:18:47 MacbookPro parentalcontrolsd[722]: StartObservingFSEvents [849:] -- *** StartObservingFSEvents started event stream
Oct 8 15:18:52 MacbookPro distnoted[728]: # distnote server agent absolute time: 38.777699557 civil time: Wed Oct 8 15:18:52 2014 pid: 728 uid: 89 root: no
Oct 8 15:19:06 MacbookPro com.apple.SecurityServer[15]: Session 100012 created
Oct 8 15:19:23 MacbookPro mds_stores[220]: (/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T)(Error) IndexGeneral in void setAttributes(si_set_attr_ctx *, Boolean):Couldn't update index oid:12019590 options:10 updateErr:-1 resolveErr:2
-- Must have died here:
Oct 8 15:20:18 MacbookPro apsd[80]: Failed to send activation record to service com.apple.ManagedClient.enroll
Oct 8 15:22:18 MacbookPro mds[56]: (Normal) Volume: volume:0x7fe256800000 ********** Bootstrapped Creating a default stor
#import "CPRNavigationController.h"
#import "CPRJobFormController.h"
@implementation CPRNavigationController
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
CPRJobFormController *controller = [segue destinationViewController];
controller.product = sender;
}
@end
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
products *product = [self.products objectAtIndex:indexPath.row];
[self.navController performSegueWithIdentifier:@"PushJobForm" sender:product];
}
- (UIButton *)submitButton {
if (_submitButton == nil) {
_submitButton = [UIButton new];
_submitButton.translatesAutoresizingMaskIntoConstraints = NO;
[_submitButton addTarget:self action:@selector(submitButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
CGRect layerBounds = _submitButton.layer.bounds;
layerBounds.size.height += 4.0f;
layerBounds.size.width += 4.0f;
_submitButton.layer.bounds = layerBounds;
_submitButton.layer.cornerRadius = 5;
- (void) someSetupMethod {
UIView *view = [UIView new];
view.userInteractionEnabled = YES;
// Target is self, self is the controller that you're in right now and will call the method iGotTapped: on itself.
UIGestureRecognizer *tap = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(iGotTapped:)];
// addGesture to view
[view addGestureRecognizer:tap];
}
//
// ViewController.m
// comprintapp
//
// Created by Ellis Gray on 8/01/2015.
// Copyright (c) 2015 Ellis Gray. All rights reserved.
//
#import "ViewController.h"
#import "NavController.h"
#import <UIKit/UIkit.h>
@interface TableViewController : UIViewController
@property (nonatomic) UITableView *tableView;
@end
@implementation TableViewController <UITableViewDelegate, UITableViewDataSource, MyCellControlProtocol>
- (void)awakeFromNib {
[super awakeFromNib];
// tap and call boxTapped
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(boxTapped:)];
tap.numberOfTapsRequired = 1;
tap.cancelsTouchesInView = NO;
// Some outlet views i wanna tap on
NSArray *controls = @[self.brandNewBox, self.reprintBox, self.alterExistingBox, self.suppliedBox, self.alterSuppliedBox];
// Assign tap gesture to all those views
for (UIView *controlView in controls) {