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 os | |
import sys | |
import yaml | |
import json | |
def get_file_list_yaml(path): | |
return [file for file in os.listdir(path) if file.endswith(".yaml")] | |
def yaml_to_json(yaml_file, json_file): | |
with open(yaml_file, 'r') as yaml_in, open(json_file, 'w') as json_out: |
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 loadFeedEntries() async throws -> Feed.Entries { | |
let feed = try await loadFeed() | |
let banners = try await loadBanner() | |
let articles = try await loadArticles() | |
let status = try await loadRegularPayment() | |
let watching = try await loadWantedPlusWatching() | |
return Feed.Entries( | |
... | |
banners: banners, |
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 loadFeedEntries() async throws -> Feed.Entries { | |
async let feed = loadFeed() | |
async let banners = loadBanner() | |
async let articles = loadArticles() | |
async let status = loadRegularPayment() | |
async let watching = loadWantedPlusWatching() | |
return try await Feed.Entries( | |
... | |
banners: banners, |
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 loadFeed() async throws -> Feed.Entries { | |
try await withCheckedThrowingContinuation { continuation in | |
fetchFeed { result in | |
continuation.resume(with: result) | |
} | |
} | |
} |
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
describe("뷰가 로드되었을 때") { | |
var interactor: EventKeywordNoticeInteractor! | |
var presenter: EventKeywordNoticePresenterMock! | |
let worker = EventKeywordNoticeWorkerMock() | |
beforeEach { | |
interactor = EventKeywordNoticeInteractor(worker: worker) | |
presenter = EventKeywordNoticePresenterMock() | |
interactor.presenter = presenter | |
} |
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
var pagingArrayForType = try feeds.nestedUnkeyedContainer() | |
var pagingContainer = pagingArrayForType | |
while(!pagingArrayForType.isAtEnd) { | |
let feedItem = try pagingArrayForType.nestedContainer(keyedBy: FeedKeys.self) | |
let type = try feedItem.decode(FeedType.self, forKey: .type) | |
switch type { | |
case .job: // decode job item | |
case .company: // decode company item | |
case .content: // decode content item | |
case .event: // decode event item |
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 | |
struct Repo: Decodable { | |
let name: String | |
let private: Bool | |
let language: String | |
} | |
let json = """ | |
[ |
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
struct Repo { | |
let name: String | |
let owner: User | |
let isPrivate: Bool | |
let license: String | |
enum CodingKeys: String, CodingKey { | |
case name | |
case owner | |
case isPrivate = "private" |
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
{ | |
"name": "LicensingViewController", | |
"owner": { | |
"login": "agiletalk", | |
... | |
"type": "User" | |
}, | |
"private": false, | |
"license": { | |
"key": "mit", |
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
struct User: Codable { | |
let login: String | |
var avatarUrl: String? | |
var name: String | |
var email: String? | |
let numberOfPublicRepos: Int | |
let numberOfPublicGists: Int | |
let followers: Int | |
let following: Int | |
NewerOlder