728x90 밍글링글링493 Svlete4, sveltekit2 으로 마이그레이션 안녕하세요. 오늘은 스벨트5, 스벨트킷2 버전으로 마이그레이션 하는 방법에 대해 알아볼건데요. 아래와 같이 버전들을 보면, 눈에 띄는 것만 보면, vite 4 버전, svelte 3.54 버전, sveltekit 1버전을 사용중인 개인플젝... 우선, sveltekit2 버전으로 마이그레이션을 시도해볼 예정입니다. npx svelte-migrate sveltekit-2 위 명령어를 입력하니, sveltekit2 버전으로 마이그레이션하기 전, svelte4 버전으로 마이그레이션이 완료된 상태에서만 진행이 가능하다고 하네요. 그래서!!... 위와 같이 마이그레이션을 진행하고, svelte4에 대한 마이그레이션이 모두 완료되고, sveltekit2 버전에 대한 마이그레이션을 계속 진행하겠냐는 문구가 노출됩니다.. svelte 2023. 12. 29. [nginx] autoindex로 디렉토리 리스팅 하였을 때 cors 에러 server { server_name *; location / { root /; autoindex on; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/*/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/*/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server.. Server/Linux 2023. 4. 10. [VSCODE] 새파일 / 새폴더 단축키 설정 ctrl + shift + p 누르면 Open keyboard Shortcuts(JSON) 으로 들어가서 설정한다. Default가 아니라서, 잘 선택하자. keybindings.json에서 [ { "key": "ctrl+n", "command": "explorer.newFile", "when": "!editorFocus" }, { "key": "ctrl+shift+n", "command": "explorer.newFolder", "when": "!editorFocus" } ] IT 2023. 4. 5. [nginx] certbot NGINX SSL 인증서 설정 및 자동 갱신(HTTPS) VER. CENTOS 기존에 블로그에 certbot 내용을 올렸지만, 그 내용은 oracle linux 위주의 내용이였기 떄문에, centos 버전으로 또 올릴까 합니다. 우선, 도메인이 있다는 가정을 하고, centos7 환경에서 할 것입니다. centos7 이상이면 모두 작동될 것입니다. SSL 적용 # EPEL 설치 yum install epel-release # CERTBOT 설치 yum install certbot # NGINX 호환 모듈 설치 yum install python-certbot-nginx 위 명령어 중에.... yum install python-certbot-nginx 해당 명령어가 안먹히는 경우, yum install python3-certbot-nginx을 붙여서 하시길 바랍니다. 필자의 같은 경우.. 카테고리 없음 2023. 4. 5. [Rust lang] 96. test-driven development fn math(input: &str) -> i32 { 9 } #[cfg(test)] mod tests { use super::math; #[test] fn one_plus_one_is_two() { assert_eq!(math("1 + 1"), 2); } #[test] fn one_minus_two_is_minus_one() { assert_eq!(math("1 - 2"), -1); } #[test] fn one_minus_minus_one_is_two() { assert_eq!(math("1 - -1"), 2); } } fn main() { } const OKAY_CHARACTERS: &str = "1234567890+- "; fn math(input: &str) -> i32 { if input.cha.. Rust 2023. 3. 31. [Rust lang] 95. builder pattern #[derive(Debug)] struct Character { name: String, age: u8, height: u32, weight: u32, lifestate: LifeState } #[derive(Debug)] enum LifeState { Alive, Dead, NeverAlive, Uncertain } impl Default for Character { fn default() -> Self { Self { name: "Billy".to_string(), age: 15, height: 170, weight: 70, lifestate: LifeState::Alive } } } impl Character { fn with_age(mut self, age: u8) -> Self { self.ag.. Rust 2023. 3. 30. [Rust lang] 94. add trait use std::ops:Add; #[derive(Debug)] struct Country { name: String, population: u32, gdp: u32 } impl Country { fn new(name: &str, population: u32, gdp: u32) -> Self { Self { name: name.to_string(), population, gdp } } } impl Add for Point { type Output = Self; fn add(self, other: Self) -> Self { Self { x: self.x + other.x, y: self.y + other.y, name: format!("{} and {}", self.name, other.name), pop.. Rust 2023. 3. 30. [Rust lang] 93. deref trait use std::ops::{Deref, DerefMut}; struct HoldsANumber(u8); impl Deref for HoldsANumber { type Target = u8; fn deref(&self) -> &Self::Target { &self.0 } } impl DerefMut for HoldsANumber { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } fn main() { let my_number = HoldsANumber(20); println!("{}", my_number.checked_add(10).unwrap() + 20); } use std::ops::Deref; struct Character { name.. Rust 2023. 3. 30. [Rust lang] 92. attribute part #[cfg(target_os = "linux")] fn do_something_if_linux() { println!("I am running in Linux"); } #[cfg(target_os = "windows")] fn do_something() { println!("I am running in Windows"); } struct JustAStruct {} fn main() { let some_char = 'a'; do_something(); } #[test] fn tests_a_thing() { } #[test] fn tests_another_thing() { } #[deprecated] fn test() { } fn main() { } Rust 2023. 3. 30. [Rust lang] 91. about impl trait use std::fmt::Display; fn generic_function(input: T) { println!("{input}"); } type MyString = impl Display; fn impl_function(input: impl Display) { println!("{input}"); } fn returns_a_closure() -> impl Fn(i32) { |x| println!("{x}") } fn main() { let my_number = 9; let my_closure = returns_a_closure(); my_closure(my_number); generic_function(8); } Rust 2023. 3. 30. [Rust lang] 90. fn mut fnonce fn fn_closure(f: F) where F: Fn() { f(); } fn fn_mut_closure(mut f: F) where F: FnMut(), { f(); } fn fn_once_closure(f: F) where F: FnOnce(), { f(); } fn main() { let mut my_string = String::from("Hello there"); /* let print_it = || { drop(my_string); }; print_if(); */ fn_once_closure(|| { my_string.push('a); println!("{my_string}"); drop(my_string); }) } Rust 2023. 3. 30. [Rust lang] 89. function pointers fn gives_five() -> u8 { 5 } fn gives_six() -> impl FnMut { 6 } fn add_to_function_output(my_function: fn() -> u8, some_number: u8) { let my_number = my_function(); let next_number = my_number + some_number; println!("We got {next_number"); } fn main() { add_to_function_output(gives_five, 8); add_to_function_output(gives_six, 8); } Rust 2023. 3. 30. 이전 1 2 3 4 ··· 42 다음 728x90