Skip to content

Instantly share code, notes, and snippets.

View theevo's full-sized avatar

Theo Vora theevo

  • Austin, TX
View GitHub Profile
/*:
# Wednesday Stretch Problem 5.3
## Palindrome
### Instructions
- Make a function that takes in a string and returns if it is a palindrome (true/false).
```
palindrome("thanks") -> false
palindrome("rAcecar") -> true
```
- Then ignore spaces.
/*:
# Monday Stretch Problem 6.1
## Game of Threes
### Instructions:
1. Make a method that takes an Int and returns an array of steps to get to 1.
2. The game goes as follows: Start with the given Int and, if it is divisible by 3, divide it by 3, otherwise ADD OR SUBTRACT 1 (whichever makes the number divisible by 3, then divide it.
3. Repeat step 2, until you reach 1.
Example: Input: 100 Output: [100, 33, 11, 4, 1]
/*:
# Tuesday Stretch Problem 6.2
## Add Ints
### Instructions:
Create a func called add where the method allows one to pass as many or as few Ints as desired and then adds them together and returns the result.
Example: If I call add(3, 7), it prints out 10. Example: If I call add(3, 7, 2, 4), it prints out 16. Example: If I call add(3, 7, 2, 9, 12, 11), it prints out 44.
*/
/*:
# Wednesday Stretch Problem 6.3
## Fibbonacci Number
### Instructions:
1. Create a function that finds the closest fibonacci number that is less than or equal to the number that is passed into a function.
2. Don't hesitate to Google what a Fibonacci number is.
3. Test it by passing in the number 2000. We will compare results.
### Black Diamond 💎💎💎
/*:
# Wednesday Stretch Problem 6.3
## Fibbonacci Number
### Instructions:
1. Create a function that finds the closest fibonacci number that is less than or equal to the number that is passed into a function.
2. Don't hesitate to Google what a Fibonacci number is.
3. Test it by passing in the number 2000. We will compare results.
### Black Diamond 💎💎💎
@theevo
theevo / gitignore
Last active May 21, 2020 23:25
for Xcode devs
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## Folders
# Comment this out to disclude framework files
# Frameworks/

Pull Request on Github, always

You want code? Pull Request

If Theo wants some code in Dave's branch, Theo should log into GitHub and pull request from Dave's branch to Theo's branch.

It will be Theo's responsibility to resolve any merge conflicts that arise from the pull.

Once the pull request is complete and any arising merge conflicts resolved, Theo will run the following command to get the code onto his local machine:

git/GitHub SOP

Standard Operating Procedures for Team Coronacation

How do I begin building my feature?

git checkout develop
git pull origin develop
git checkout -b 

Roadmap for Chat

  1. Table View that shows list of Chats
  2. Segue to individual chats from Table View (and segue back)
  3. Instantiate chat from Post detail
  4. Integrate Firebase Cloud Messaging for iOS push notifications
import Foundation
extension Date {
func timeAgoString() -> String {
let units = Array<Calendar.Component>([.year, .month, .day, .hour, .minute, .second])
let components = Calendar.current.dateComponents(Set(units), from: self, to: Date())
for unit in units
{
guard let value = components.value(for: unit) else {