Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// Banner
//
// Created by chris.jy on 2023/08/21.
//
//import SwiftUI
//struct ContentView: View {
@junyng
junyng / Carousel.swift
Created September 8, 2022 01:39
Scroll Snap Carousel
@junyng
junyng / scrollable_stackview.swift
Last active October 10, 2024 00:18
scrollable stackview
let scrollView = UIScrollView()
scrollView.translatesAutoresizingMaskIntoConstraints = false
let images = [
UIImage(named: "animal1"),
UIImage(named: "animal2"),
UIImage(named: "animal3"),
UIImage(named: "animal4")
]
let imageViews = images.map { image -> UIImageView in
let imageView = UIImageView(image: image)
//
// ViewController.swift
// CollectionViewPractice
//
// Created by nTom on 2020/10/26.
// Copyright © 2020 CollectionViewPractice. All rights reserved.
//
import UIKit
import SnapKit
@junyng
junyng / py_trie.py
Created February 7, 2021 12:38 — forked from osori/py_trie.py
파이썬에서 Trie 구현
class Trie(object):
def __init__(self):
self.head = Node(None)
"""
트라이에 문자열을 삽입합니다.
"""
def insert(self, string):
curr_node = self.head
@junyng
junyng / swift4-kvo-playground.swift
Created January 2, 2020 06:51 — forked from JoshuaSullivan/swift4-kvo-playground.swift
Here is a playground demonstrating how to set up Swift 4 KVO.
//: # Setting up Swift 4 KVO
import Foundation
//: This class has a pair of properties that can be observied by KVO.
//: - Note: This class *must* inheret from `NSObject` in order to posess the KVO functionality.
class ObservableClass: NSObject {
/// An observable string property. Note that it most be annotated with both "@objc" (expose the property to the
/// Objective-C runtime) and "dynamic" (enables KVO for the property).
@objc dynamic private(set) var stringProperty: String = "Starting string!"
@junyng
junyng / main.swift
Last active April 9, 2019 06:07
swift-unitconverter
//
// main.swift
// UnitConverter
//
// Created by BLU on 2019. 4. 1..
// Copyright © 2019년 BLU. All rights reserved.
//
import Foundation
/// 단위 측정 타입 정의
@junyng
junyng / main.swift
Created April 2, 2019 05:09
PairProgramming
//
// main.swift
// PairProgramming
//
// Created by Blu X Bean on 2019. 4. 2..
// Copyright © 2019년 Blu Bean. All rights reserved.
//
import Foundation
@junyng
junyng / .git-commit-template.txt
Created May 29, 2018 22:28 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@junyng
junyng / snakecoin.py
Created February 19, 2018 11:19 — forked from aunyks/snakecoin.py
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash