Skip to content

Instantly share code, notes, and snippets.

View kidap's full-sized avatar

Karlo Pagtakhan kidap

  • Toronto, Canada
View GitHub Profile
history | grep "cat" | wc -l
cat /usr/share/dict/words |grep "^a" |wc -l
cat /usr/share/dict/words |grep "^a"|grep "s$"
curl www.lighthouselabs.ca/index.html >savedHTML.html
@kidap
kidap / gist:6d1c68eb316e8d37c2ab
Created March 7, 2016 19:42
W1D1 - Gitting comfortable with Git (Git it?)
git help config
git config --global user.name "karlo"
git init
git status
git add "index.html"
git commit -m "Add index.html"
git add css/
git log
@kidap
kidap / gist:daf4c6f891f8f5388303
Created March 7, 2016 23:35
W1D1 - Lecture - Intro to Obj C
Write a command that will output the number of times the cat command was used previously
-history | grep "cat" | wc -l
Write a command to output a count of all words in the unix dictionary file that begin with the letter "a"
-cat /usr/share/dict/words |grep "^a" |wc -l
What operating system (OS) vendor and version is your vagrant box running?
-
What UNIX command did you run to get the answer to the previous question?
@kidap
kidap / gist:790a0bdbe65b3441ee6a
Created March 9, 2016 00:25
W1D2 Readings & Questions
Q1
What is it mean when you say a language is object-oriented and why could it be considered an improvement over a procedural language?
-OOP is using objects to represent data and implement functions to encapsulate and modularize the code.
Q2
What are structures and why are they useful?
-structures allow the code to be group accordingly
Q3
What is the difference between an instance method and a class method and how do you differiate the two?
@kidap
kidap / gist:b4736030089ad4382e4f
Created March 10, 2016 22:43
W1D4 Readings & Questions
Q1: What is an instance variable?
- instance variable is a variable that is owned by an instantiated object.
Q2: The 4 Pillars of Object Oriented Programming are Abstraction, Encapsulation, Inheritance and Polymorphism. Describe each one.
Abstraction - to "hide" the logic and control what can be accessed or called by other objects
Encapsulation - to combine related objects, data and operations into a single unit
Inheritance - enable objects to receive/inherit the properties/attributes and methods without requiring it to re-declare or re-implement it
Polymorphism - allows the properties and methods of subclasses to have a different behavoir.
Q3:
tmpgist
@kidap
kidap / gist:145e39382a4ac8e60a8b
Last active March 15, 2016 20:39
W1E Readings & Questions
Q1 Explain the different components of MVC - what are their responsibilities?
- Model - data source/holder
- View - all the UI elements
- Controller - displays the view and handles all the interaction between the model and view
Q2 What are some benefits of having an NSObject protocol separate from the NSObject class?
- When delegates conform to the NSObject protocol, the delegates will inherit the retain and release methods. Also, all the objects that will conform to the protocol are required to conform to NSObject protocol
-
Q3 Given the following person class, create a subclass LLShoutingPerson whose designated initializer is initWithLoudMessage:. Write the implementation for LLShoutingPerson's initializer.
@kidap
kidap / gist:b9d04439249f5319713f
Created March 15, 2016 21:02
W2D1 Readings & Questions
Q1 We are writing an application that makes use of a custom view. This is the header file of our custom view class:
@interface LLView : UIView
@property (nonatomic, weak) UIViewController* parentViewController;
-(instancetype)initWithFrame:(CGRect)frame parent:(UIViewController*)parentVC;
-(void)configureViewWithObject:(LLObject*)object;
@end
Our view also detects taps. When it is tapped, it runs the following code:
LLViewController* nextViewController = [[LLViewController alloc] init];
[self.parentViewController presentViewController:nextViewController];
All test passed.
Issue with Test 06 instructions - There is no Giant salmon at depth 2, tile 1