Skip to content

Instantly share code, notes, and snippets.

View trilliwon's full-sized avatar
🎯
Focusing

WonJo trilliwon

🎯
Focusing
View GitHub Profile
@trilliwon
trilliwon / swiftui.mdc
Last active February 24, 2025 04:42
cursor rules for swift
# SwiftUI Best Practices for iOS App Development
When generating code, finding bugs, or optimizing SwiftUI projects, follow these guidelines:
Never modify files without my consent.
Only work on the exact feature I request.
Don't duplicate files or functionalities.
## General Guidelines
@trilliwon
trilliwon / JWTGenerator.ts
Created January 22, 2025 02:14
JWTGenerator written in ts
export class JWTGenerator {
private keyId: string;
private issuerId: string;
private privateKey: string;
constructor(keyId: string, issuerId: string, privateKey: string) {
this.keyId = keyId;
this.issuerId = issuerId;
// Normalize private key format
this.privateKey = privateKey.replace(/\\n/g, '\n');
$ git branch | fzf
$ git switch $(git branch | fzf)
$ git checkout $(git for-each-ref refs/heads/ --format='%(refname:short)' | fzf)

Or add below script to .zshrc

@trilliwon
trilliwon / ts-commands-01.md
Last active December 18, 2021 16:03
ts scripts
npm install -g ts-node
npm install -g typescript
ts-node ***.ts

tsc main.ts && node main.js

npx ts-node-dev --respawn main.ts

I had an error start postgre local server like PostgreSQL stale ‘postmaster.pid’ error

  • To fix this error should just remove postmaster.pid file. This issue happens when the PostgreSQL process dies without cleaning up its pid file.

Delete postmaster.pid

  • cd Library/Application\ Support/Postgres/var-13/
  • rm postmaster.pid

Standard ML Topics


Pairs, Lists, Local Bindings, Benefit of No Mutation

Records, Datatypes, Case Expressions and more

  • A variable binding

First class functions

함수가 expression 으로 사용될 있으면 일급함수이다. 오브젝트로서 사용될 수 있으면 일급함수. 함수를 값으로써 변수에 대입하거나 함수의 리턴값으로 사용되면 일급함수다.


Higher-Order Functions (고차함수)

Generic term is Test Double. 테스트에서 사용할 때 production object를 대신하는 용어다.

Dummy

objects are passed around but never actually used. Usually they are just used to fill parameter lists. 실제로 사용되지 않으며 파라미터로 넘겨질 수 있는 오브젝트, 단지 파라미터 리스트를 채우기 위해 사용함.

Fake