Skip to content

Instantly share code, notes, and snippets.

View jsryudev's full-sized avatar

Junsang Ryu jsryudev

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 6, 2025 05:33
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

import React
import UIKit
class SecureImageView: UIView {
@objc var url: String = "" {
didSet {
do {
let imageUrl = URL(string: url)
let data = try Data(contentsOf: imageUrl!)
let image = UIImage(data: data)
@pilgwon
pilgwon / TCA_README_KR.md
Last active April 18, 2025 05:05
TCA README in Korean

The Composable Architecture

The Composable Architecture(TCA)๋Š” ์ผ๊ด€๋˜๊ณ  ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ์‹์œผ๋กœ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด ํƒ„์ƒํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค. ํ•ฉ์„ฑ(Composition), ํ…Œ์ŠคํŒ…(Testing) ๊ทธ๋ฆฌ๊ณ  ์ธ์ฒด ๊ณตํ•™(Ergonomics)์„ ์—ผ๋‘์— ๋‘” TCA๋Š” SwiftUI, UIKit์„ ์ง€์›ํ•˜๋ฉฐ ๋ชจ๋“  ์• ํ”Œ ํ”Œ๋žซํผ(iOS, macOS, tvOS, watchOS)์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

@V8tr
V8tr / AutoLayoutDSL.swift
Last active March 23, 2025 19:10
Auto Layout DSL
import UIKit
/// Represents a single `NSLayoutConstraint`
enum LayoutAnchor {
case constant(attribute: NSLayoutConstraint.Attribute,
relation: NSLayoutConstraint.Relation,
constant: CGFloat)
case relative(attribute: NSLayoutConstraint.Attribute,
relation: NSLayoutConstraint.Relation,
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'GT America', sans-serif;
}
div,
@GeekTree0101
GeekTree0101 / ASVideoNode-Feed-Example.swift
Last active January 13, 2021 03:01
Simple Video Feed Performance Improvement Experiment
import AsyncDisplayKit
struct VideoProcessing {
private static let loadOperation: OperationQueue = {
let operationQueue = OperationQueue()
operationQueue.maxConcurrentOperationCount = 3
operationQueue.name = "com.VideoFeedController.VideoLoaderOperation"
operationQueue.qualityOfService = .utility
return operationQueue
}()
@godrm
godrm / swift_api_guideline.md
Last active February 20, 2025 11:30
์Šค์œ„ํ”„ํŠธ API ๊ฐ€์ด๋“œ๋ผ์ธ

1. ์Šคํƒ€์ผ/๋ฌธ๋ฒ• ๋ฆฌ๋ทฐ

1-1 ์Šค์œ„ํ”„ํŠธ API ๋””์ž์ธ ๊ฐ€์ด๋“œ๋ผ์ธ

https://swift.org/documentation/api-design-guidelines/

  • ์‚ฌ์šฉํ•  ๋•Œ ๊ธฐ์ค€์œผ๋กœ ๋ช…ํ™•ํ•˜๊ฒŒ ์ž‘์„ฑํ•˜๋Š” ๊ฒŒ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์ง€ํ–ฅ์ ์ด๋‹ค. ๋ฉ”์†Œ๋“œ๋‚˜ ํ”„๋กœํผํ‹ฐ ๊ฐ™์€ ๊ฐœ๋ฐœ ์š”์†Œ๋Š” ํ•œ ๋ฒˆ๋งŒ ์„ ์–ธํ•˜๊ณ  ๋ฐ˜๋ณต์ ์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค. API๋ฅผ ๋งŒ๋“ค ๋•Œ๋Š” ์‚ฌ์šฉํ•˜๊ธฐ ๋ช…ํ™•ํ•˜๊ณ  ํŽธํ•˜๊ฒŒ ๋งŒ๋“ค์–ด์•ผ ํ•œ๋‹ค. ์„ค๊ณ„๋ฅผ ๊ฒ€์ฆํ•  ๋•Œ ์„ ์–ธ ๋ถ€๋ถ„์„ ์ฝ๋Š” ๊ฒƒ๋งŒ์œผ๋กœ๋Š” ๋ถ€์กฑํ•˜๋‹ค. ๊ทธ ๋Œ€์‹  ์‚ฌ์šฉํ•˜๋Š” ์ƒํ™ฉ์—์„œ ๋งฅ๋ฝ์— ๋งž๊ณ  ๋ช…ํ™•ํ•œ ์ง€ ๋Š˜ ๊ณ ๋ คํ•ด์•ผ ํ•œ๋‹ค.

  • ๋ช…ํ™•ํ•œ ํ‘œํ˜„์ด ์••์ถ•ํ•œ ๊ฐ„๊ฒฐ์„ฑ๋ณด๋‹ค ๋” ์ค‘์š”ํ•˜๋‹ค. ์Šค์œ„ํ”„ํŠธ ์ฝ”๋“œ๋Š” ์••์ถ•ํ•ด์„œ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋‹จ์ง€ ๊ธ€์ž์ˆ˜๋ฅผ ์ค„์—ฌ์„œ ๊ฐ€์žฅ ์งง์€ ์ฝ”๋“œ๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒŒ ๋ชฉํ‘œ๋Š” ์•„๋‹ˆ๋‹ค. ์Šค์œ„ํ”„ํŠธ ์ฝ”๋“œ์˜ ๊ฐ„๊ฒฐ์„ฑ์€ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋ฐ˜๋ณต์ ์œผ๋กœ ์žฌ์‚ฌ์šฉํ•˜๋Š” ์ฝ”๋“œ(boilerplate)๋ฅผ ์ค„์ด๋Š” ๊ธฐ๋Šฅ๊ณผ ๊ฐ•ํ•œ ํƒ€์ž… ์‹œ์Šคํ…œ์˜ ๋ถ€์ˆ˜ํšจ๊ณผ๋กœ ๋“œ๋Ÿฌ๋‚  ๋ฟ์ด๋‹ค.

@0xjac
0xjac / private_fork.md
Last active May 7, 2025 05:17
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"