Skip to content

Instantly share code, notes, and snippets.

View WhiteHyun's full-sized avatar

SeungHyun Hong WhiteHyun

View GitHub Profile
@WhiteHyun
WhiteHyun / main.py
Created December 12, 2021 10:17
tkinter 외주
from tkinter import *
# 창 생성
win = Tk() # 창을 변수로 만들어주어야 한다
win.geometry("700x500") # 창 크기
win.resizable(height=None, width=None) # 창 크기 조절 가능?
win.title("todolist") # 창 제목
# win.option_add("*Font","맑은고딕 10") # 글씨체, 크기
# 화면분할용 프레임
@WhiteHyun
WhiteHyun / 23844.py
Created January 18, 2022 08:31
boj 트리 정리하기
#
# 23844번: 트리 정리하기
# https://www.acmicpc.net/problem/23844
# Version: Python 3.9.7
#
# Created by WhiteHyun on 2021/12/18.
#
from sys import stdin, setrecursionlimit
@WhiteHyun
WhiteHyun / 미로 탈출 명령어.swift
Created August 16, 2023 02:31
프로그래머스 - 미로 탈출 명령어 (Swift)
//
// 미로 탈출 명령어
// https://school.programmers.co.kr/learn/courses/30/lessons/150365
//
// Created by whitehyun on 2023/08/15.
//
import Foundation
struct Queue<Element> {
@WhiteHyun
WhiteHyun / 합승 택시 요금.swift
Last active August 21, 2023 13:40
프로그래머스 - 합승 택시 요금 (Swift)
/// 합승 택시 요금 문제 풀이
struct Number72413 {
/// 합승 택시 요금 문제 풀이
/// - Parameters:
/// - n: 지점의 개수
/// - startNumber: 시작 정점
/// - a: A의 목표 정점
/// - b: B의 목표 정점
@WhiteHyun
WhiteHyun / Queue.swift
Created September 5, 2023 04:52
Swift Queue
struct Queue<Element> {
private var frontArray: [Element] = []
private var backArray: [Element] = []
mutating func append(_ element: Element) {
backArray.append(element)
}
mutating func popFirst() -> Element? {
if !frontArray.isEmpty { return frontArray.popLast() }
// Author: SwiftUI-Lab (www.swiftui-lab.com)
// Description: This code is part of the "Advanced SwiftUI Animations - Part 5"
// Article: https://swiftui-lab.com/swiftui-animations-part5/
import SwiftUI
struct ContentView: View {
var body: some View {
ClockView()
.background(.gray)
@WhiteHyun
WhiteHyun / Package.swift
Created June 18, 2024 05:20
OpenAPI Generator Server
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: "OpenAPIService",
platforms: [
.macOS(.v14),
],
dependencies: [
@WhiteHyun
WhiteHyun / openapi.yaml
Last active June 18, 2024 06:12
OpenAPI yaml
openapi: "3.1.0"
info:
title: "App"
version: "1.0.0"
servers:
- url: "https://api.path.com/v1"
description: "Production Server"
- url: "https://localhost/v1"
description: "Internal staging server for testing"
@WhiteHyun
WhiteHyun / main.swift
Created June 18, 2024 06:27
Vapor - basic execution
import Vapor
let app = Application()
try app.run()
@WhiteHyun
WhiteHyun / main.swift
Created June 18, 2024 07:12
Vapor with APIProtocol
import Foundation
import Vapor
import OpenAPIRuntime
import OpenAPIVapor
struct GreetingService: APIProtocol {
func getGreeting(_ input: Operations.getGreeting.Input) async throws -> Operations.getGreeting.Output {
let name = input.query.name ?? "Stranger"
let greeting = Components.Schemas.Greeting(message: "Hello, \(name)!")
return .ok(.init(body: .json(greeting)))