Skip to content

Instantly share code, notes, and snippets.

@twinstae
twinstae / coding-is-fun-question-mark.md
Last active April 18, 2024 04:23
코딩은 재미 있나요?

안녕하세요. 탐토입니다. 오늘은 코딩이 어떻게 하면 재미있어질 수 있는지에 대해 이야기해보려 해요.

요약

  • 자전거 배달부로 아기를 돌보는 분들에게 기저귀와 분유 배달하는 것도 보람찬 일이었다.
  • 코딩으로 가치있는 문제를 해결하는 것도 힘들지만 즐거웠으며, 보람찬 일을 하는 건 노동자의 권리다.
  • 천재 슈퍼 개발자가 아니면 무시 받아 마땅하고 해고와 연봉 삭감의 사유라는 것은 자본가들의 가스라이팅일 뿐이다.
  • 누구나 자기의 속도로 하나 둘 해나가면 성장하고 성취하고 즐거움을 찾을 수 있다.
  • 쓸모 없지만 재미있는 일을 하다보면 쓸모도 생기는 것이지. 쓸모에 집착하면 우울해집니다.

저는 부럽다는 말을 많이 듣습니다. 물론 잘 알지도 못하면서 아는 척 한다고 욕도 먹습니다만. 부럽다는 레파토리 중에 하나는 "토끼 님은 코딩이 재미있어 보인다"는 것입니다.

@el-hoshino
el-hoshino / AssociativeComparisonPrecedence.swift
Last active February 5, 2024 22:40
AssociativeComparison
precedencegroup AssociativeComparisonPrecedence {
associativity: left
higherThan: ComparisonPrecedence
lowerThan: NilCoalescingPrecedence
}
infix operator <: AssociativeComparisonPrecedence
infix operator <=: AssociativeComparisonPrecedence
public func < <V: Comparable>(lhs: V, rhs: V) -> (Bool, V) {
@unixzii
unixzii / ContentView.swift
Last active March 30, 2024 08:36
GPU particle system using Metal.
import SwiftUI
struct SmashableView: NSViewRepresentable {
typealias NSViewType = _SmashableNSView
let text: String
class _SmashableNSView: NSView {
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 22, 2024 06:37
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@Alex-Ozun
Alex-Ozun / typestate-tesla-car.swift
Last active March 22, 2024 10:03
Typestate in Swift
enum Parked {}
enum Driving {}
enum Gaming {}
private class EngineSystem {
static var shared = EngineSystem()
private init() {}
func start() {/**/}
func accelerate() { /* Uses gas pedal input to accelerate the real car */ }
@unixzii
unixzii / WeatherView.swift
Created November 7, 2023 13:21
A demo of implementing iOS Weather card in SwiftUI.
import SwiftUI
struct HeaderView: View {
var body: some View {
HStack {
Image(systemName: "info.circle.fill")
.resizable()
.frame(width: 12, height: 12)
Text("Section Header")
.font(.system(size: 13))
@timsneath
timsneath / dragcard.swift
Created October 17, 2023 04:46
Small sample of a draggable card object in SwiftUI
// Adapted from Hacking with SwiftUI, credit to Paul Hudson (@twostraws).
// https://www.hackingwithswift.com/books/ios-swiftui/animating-gestures
import SwiftUI
struct ContentView: View {
@State private var dragAmount = CGSize.zero
var body: some View {
RoundedRectangle(cornerRadius: 10)
@DominatorVbN
DominatorVbN / ChoasGame.swift
Created October 1, 2023 09:25
Simulation of mathematical concept of Chaos Game
import SwiftUI
import SwiftData
// TODO: Make this animatable shape
struct Polygon: Shape {
var edges: Int
var pathUpdated: (Path) -> Void
var vertexUpdated:([CGPoint]) -> Void
import UIKit
/// このプロトコルで画面遷移のインターフェースを共通化
protocol Coordinator {
func start()
}
/// 初期起動経路を管理するクラス
final class AppCoordinator: Coordinator {
// プロパティとしてUIWindowとUINavigationControllerを保持する
@minsOne
minsOne / DataState.swift
Last active September 26, 2023 11:11
SwiftUI DataState
enum DataState<V, E: Error> {
case idle
case initialLoading case reLoading (V)
case retryLoading (E)
case success (V)
case failure(E)
case paging (V)
case pagingFailure(V, E)
}