This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)gitCommands { | |
return @[@{Command: @"git status", Reference: @": shows changed files"}, | |
@{Command: @"git diff", Reference: @": shows actual changes"}, | |
@{Command: @"git add .", Reference: @": adds changed files to the commit"}, | |
@{Command: @"git commit -m \"notes\"", Reference: @": commits the changes"}, | |
@{Command: @"git push origin _branch_", Reference: @": pushes commits to branch named _branch_"}, | |
@{Command: @"git log", Reference: @": displays progress log"}, | |
@{Command: @"git comment --amend", Reference: @": re-enter last commit message"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This goes in the header file | |
+ (EntryController *)sharedInstance; | |
// This goes in the implementation file | |
+ (EntryController *)sharedInstance { | |
static EntryController *sharedInstance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
sharedInstance = [[EntryController alloc] init]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)data { | |
return @[ | |
[self fruits], | |
[self liquids], | |
[self desserts] | |
]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See tic tac toe by Lenli https://github.com/lenli/tictactoe | |
-(BOOL)isGameOver { | |
NSArray *winCombinations = [[NSArray alloc] initWithObjects: @[@1,@2,@3], @[@4,@5,@6], @[@7,@8,@9], | |
@[@1,@4,@7], @[@2,@5,@8], @[@3,@6,@9], | |
@[@1,@5,@9], @[@3,@5,@7], nil]; | |
for (NSArray *winCombination in winCombinations) { | |
BOOL isWinner = TRUE; | |
for (NSNumber *winIndex in winCombination) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Stack.m | |
// | |
// Created by Joshua Howland on 6/12/14. | |
// Copyright (c) 2014 DevMountain. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@import CoreData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func gitCommands() -> Array<[String: String]> { | |
var commands = [[String: String]]() | |
commands.append([Command: "git status", Reference: ": shows changed files"]) | |
commands.append([Command: "git diff", Reference: ": shows actual changes"]) | |
commands.append([Command: "git add .", Reference: ": adds changed files to the commit"]) | |
commands.append([Command: "git commit -m \"notes\"", Reference: ": commits the changes"]) | |
commands.append([Command: "git push origin _branch_", Reference: ": pushes commits to branch named _branch_"]) | |
commands.append([Command: "git log", Reference: ": displays progress log"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static CGFloat margin = 15; | |
static NSString * const Command = @"command"; | |
static NSString * const Reference = @"reference"; | |
- (NSArray *)gitCommands { | |
return @[@{Command: @"git status", Reference: @": shows changed files"}, | |
@{Command: @"git diff", Reference: @": shows actual changes"}, | |
@{Command: @"git add .", Reference: @": adds changed files to the commit"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RARecipes.h | |
// Recipe App | |
// | |
// Created by Joshua Howland on 5/22/14. | |
// Copyright (c) 2014 DevMountain. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)savePhoto:(UIImage *)photo completion:(void (^)(void))completion { | |
CGSize scaledSize = CGSizeMake(512, 512); | |
if (photo.size.width > photo.size.height) { | |
CGFloat ratio = photo.size.height / photo.size.width; | |
scaledSize.height = round(scaledSize.width * ratio); | |
} else { | |
CGFloat ratio = photo.size.width / photo.size.height; | |
scaledSize.width = round(scaledSize.height * ratio); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)takePhoto:(id)sender { | |
self.photoCount++; | |
[self.tableView reloadData]; | |
} | |
#pragma mark - Table view data source | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
PhotoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PhotoCell"]; |
OlderNewer