본문 바로가기

전체 글

(266)
[JS] return new Response 본 글은 무료 Gemini를 통해서 작성된 자료입니다.보통 뒷단에서 쓰는 것으로 예상새 응답 개체를 생성하여 호출자에게 다시 보내기 전에 속성 및 본문 콘텐츠(data.status or header etc)를 사용자 지정할 수 있습니다.클라이언트에 보내기 전에 응답 데이터나 헤더를 조작해야 할 때 유용. fetch('/data')   .then(response => {     if (!response.ok) {       return new Response('Error fetching data', { status: 500, statusText: 'Internal Server Error' }); }       return response.clone(); // Create a copy of the origi..
[JS/Type] 더 명확한 작성법 함수 작성법 function createCourse(): { name: string; isPaid: boolean } { ... }function createCourse(): { name: string; isPaid: boolean } { ... }Return TypeInferred from the object parameterExplicitly defined after a colonType SafetyLess strict, potential for runtime errorsStricter, compiler checks for correct return typeReadabilityLess clear about the return typeClearer, self-documenting with explicit retur..
[JS/Type] void (update : 2024.04) void : 결과 값을 반환하지 않는 함수함수 : void, never, [ ]never : 반환값(return) 정의 가능.(다만, 일반적인 정의 아님) => ex) throw Error(message);- 확인 하기 어려운 값 + 함수가 예외 or 프로그램을 종료한다는 뜻The never type represents values which are never observed. In a return type, this means that the function throws an exception or terminates execution of the program.never also appears when TypeScript determines there’s nothing left in a union. ..
[CSS] infinite scrolling X 포인트 :  전체 logos에서  자식 를  block에서 inline-block으로 만들어서 무제한 scrolling을 시키는 것==> No display FLEX animation   from { transform : translateX( 0 ) }   to { transform : translateX(-100%) }출처https://www.youtube.com/watch?v=nAjR0Oj0J8E
[article] ‘신경 끄기의 기술’ 마크 맨슨 인터뷰 from 김지수의 인터스텔라 -하지만 누가 쾌락보다 고통을 먼저 계산하겠나? “실제로 우리는 만족감에 젖어 있기보다 고군분투하면서 생의 대부분 시간을 보낸다. 사는 건 어차피 고군분투다. 원하는 것을 이뤘더라도 고통과 문제는 계속된다. 문제없는 삶이란 없으니까. 그래서 질문해야 한다. 나는 어떤 종류의 고통을 견딜 수 있나? 어떤 것이 내게 가치 있는 고통인가? 고통을 당연한 것으로 여기고, 뇌가 신경 끄도록 자동으로 만든 패턴이 좋은 습관이고 루틴이다.” -그런데 당신은 마약과 파티와 술로 인생 초반을 탕진했다고 고백하지 않았나? 좋은 습관과는 거리가 멀었던 거로 아는데. “맞다. 일찍부터 인생의 쓴맛을 봤다. 십 대 때 가방에 숨긴 마약을 들켜서 퇴학당했다. 당시 나는 기능이 결여된 가족과 부모님에게 화가 나 있었던 것 같다. ..
[JS] How Promise works 이 자료는 아래의 블로그에서 가져온 정보입니다. https://lydiahallie.framer.website/blog/promise-execution Promise의 Process a new promis object is created in memory. the promis object contains some internal slots( [[PromiseState]], [[PrmiseResult]], [[PromiseFulfillReactions]], [[PromiseRejectReactions]], [[PromiseIsHandled]] [[PromiseFulfillReactions]], [[PromiseRejectReactions]] These fields contain something calle..
[ React/ 원리 ] Basic, DOM by declarative DOM(선언적 DOM) 목차1. 명령적 코드 vs 선언적 코드2. 어떻게 React는 버추얼 돔으로 HTML을 그리는가2-1. POJO code2-2. Component2-3. Props2-4. JSX2-5. FRAGMENT & HTML AUTHORING2-6. FIBER AND RECONCILIATION HTML TREEchildren that is one object knows where another object is located in memory we represent that visually some arrows.  The Document Object Model(DOM)a collection of objects in the comuputer's memory that represent the HTML elements ..
[article/AI]Where is the A.I heading? Of course, there is the argument that new technology improves our standard of living in the long term, which makes up for the unemployment that it creates in the short term. This argument carried weight for much of the post-Industrial Revolution period, but it has lost its force in the past half century. In the United States, per-capita G.D.P. has almost doubled since 1980, while the median hous..
[Javascript/Json] Json 데이터를 만들기 위한 크롤링 최근에 누군가가 콘솔에 스크립트를 써, 정보를 추출하는 것을 보고 나도 따라해 봤다. json 데이터 만들려고 코드 작성(ai+코드 좀 수정)유용하다. 이렇게 간단한 데이터를 추출해 봤다. // Select all product tiles var productTiles = document.querySelectorAll('.product-tile'); // Iterate over each product tile productTiles.forEach(function(tile) { // Get the title var title = tile.querySelector('.tile-body .pdp-link').textContent; // Get the image URL var imageUrl = tile.que..
[Js/format ] 날짜, 통화 데이터 등의 정보를 변환해주는 함수 통화(ts)const CURRENCY_FORMATTER = new Intl.NumberFormat(undefined, { currency : "ko", style:"currency",})export const formatCurrency = (number : number) =>{ return CURRENCY_FORMATTER.format(number)} 출처 : 직접 날짜예를 들어, 현재 날짜를 한국 사용자들을 위한 형식으로 변환하고 싶다면 DateTimeFormat() 생성자로 포맷터를 생성한 객체의 format() 함수를 호출하면 됩니다.> const koDtf = new Intl.DateTimeFormat("ko", { dateStyle: "long" });undefined> koDtf.format(..
[Video/AI] 실리콘벨리 한기용 선생님의 실패 이야기 최근에 AI 글을 일고 2차 wave대한 고민을 하게 됐다. 이상하게 다른 곳에서(?) 나름의 좋은 해안을 얻었다. '내 직업만 위험한게 아니다. 모든 직업이 위험하다. 고로 지금이 가장 좋은 타임아닌가? 내가 원하는 것을 하기에'
[article/AI] 2번째 AI 물결은 비루틴적(non-routine)인 것들이 목표가 된다. 글의 내용은 현재 1의 물결은 이미 우리 삶에 많은 부분을 대체하고 있다고 하고 있다. 특히 루틴적이 일(a job)들이 대체되고 있다고 했다. 다만 2번째 물결은 비루틴적인 일들이 대체될 것이라고 했다. 예를들어, DB 설계, 글쓰기는 일, 그래픽 디자인 등 고소득일도 점점 AI에 대체될 것으로 예상했다. the second wave of AI adoption could impact non-routine tasks involving the creation of databases, copywriting and graphic design, However, the second wave of AI adoption could impact non-routine tasks involving the creation ..