Skip to content

Instantly share code, notes, and snippets.

View theevo's full-sized avatar

Theo Vora theevo

  • Austin, TX
View GitHub Profile
import Foundation
class Solution {
static let openingChars = "({["
static let closingChars = ")}]"
var stack: [String.Element] = []
private func pushClosingChar(_ char: String.Element) {
class Solution {
func letterToInt(_ s: String.Element) -> Int {
switch s {
case "I":
return 1
case "V":
return 5
case "X":
return 10
case "L":
@theevo
theevo / DispatchGroup.swift
Created May 11, 2020 01:51
my first and successful implementation of DispatchGroup in Swift. I'm still shaky on why it works, but it does. 🤷
func constructUsers() {
print("#ChatListTVC Starting constructUsers()")
let group = DispatchGroup()
for otherUserUid in userUids {
group.enter() // entering the closure
User.getBy(uid: otherUserUid, completion: { (user) in
self.users.append(user)
print("Chat List appended: \(user.firstName)")
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 {

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

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 

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:

@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/
/*:
# 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 💎💎💎