A coding challenge for prospective Senior iOS Developers applying for a role on the IBA iOS developer team.
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
const MY_DOMAIN = 'rezaarkan.com'; | |
const SLUG_TO_PAGE = { | |
'': '882cd6dd6e1e482d823b464f326213e5', | |
'now': '25b7df64071d420d8f609bf76d9f4114', | |
'portfolio': '6000547bed0d441793bfba1498c063e2', | |
'resume': '0934b80d2d1544f99dedadb00be9d146', | |
'recommendations': '29115129efa44f1a870f390dd2c0a6c0', | |
'photos': 'e78c0492a5ec486aa51f4cdb2c6f4603', | |
'blog': '29bb193c1a104ba2b832788b57d58cd6', |
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
// | |
// HomeRecap.swift | |
// iosApp | |
// | |
import SwiftUI | |
import shared | |
struct HomeRecap: View { | |
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
Client Key: A2a9SfT4NeFBl6df5cu42 | |
API Key: mnqWGdu4OfLBwwJPee6cpjkeY70qv9mKicqZYvtHJ |
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
1. Installing | |
apt-get install supervisor | |
service supervisor restart | |
2. Setting shell script | |
nano /usr/local/bin/rake.sh | |
#!/bin/bash |
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
# space150 vine-to-GIF | |
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it | |
# requires ruby, ffmpeg, and imagemagick | |
require 'open-uri' | |
require 'nokogiri' | |
id = ARGV[0] | |
# try to convert from URL to id. |
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
import Lokalise | |
func applicationDidBecomeActive(_ application: UIApplication) { | |
Lokalise.shared.checkForUpdates { _, _ in } | |
} |
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
import UIKit | |
import Firebase | |
import FirebaseAnalytics | |
//MARK - Analytics Service | |
protocol AnalyticsService { | |
func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
func track(event: AnalyticsEvent, parameters: [AnalyticsEventParameter : String]) | |
var trackingEvents: [AnalyticsEvent] { get } |
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
import Foundation | |
extension DispatchQueue { | |
func asyncConsumeInMainQueue<T>( | |
work: @escaping () throws -> T, | |
mainSuccess: @escaping (T) -> Void, | |
mainError: @escaping (Error) -> Void) { | |
async { | |
do { | |
let result = try work() |
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
import UIKit | |
public protocol AnalyticsServiceType { | |
var trackedEvents: [AnalyticsSectionEvent] { get } | |
func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
func track(event: AnalyticsEvent) | |
} | |
extension AnalyticsServiceType { | |
func shouldTrack(event: AnalyticsSectionEvent) -> Bool { |