본문 바로가기

전체 글138

Python Basic Syntax arithmatic operators 1 + 3 >> 4 1 - 3 >> -2 1 / 3 >> 0.3333333 5 // 2 # quotator >> 2 5 % 2 # remainder >> 1 divmod(5, 2) # quotator and remainder at once >> (2, 1) division by 0 occurs ZeroDivisionError if if a % 2 === 0 or a > 10: print("") elif a > b and a // b > 1: # // is for get the quotient print() else: print() # tenary operator '짝수' if a % 2 == 0 else '홀수' for문 for x in family: print(x,.. 2023. 8. 22.
[JSDoc] Practical commenting out with JSDoc If we write code with proper naming and good readability, we might argue that comments are unnecessary because the code itself explains everything. However, there are times when we need to explain aspects of the code that are external to the project. Additionally, there may be similar functions that have slightly different functionalities (although it's better to avoid such situations). For exam.. 2023. 5. 24.
[Javascript] How to Iterate through Lists in JavaScript Here is a basic way to iterate through a list in JavaScript: const list = [1, 2, 3]; for (var i = 0 ; i < list.length ; i++){ console.log(list[i]); } Alternatively, you can use the of keyword instead of using an index: const list = [1,2,3] for(const item of list){ console.log(item); } for (const a of arr) console.log(a); // You can also use inline syntax You can create arrays using square bracke.. 2023. 5. 24.
Troubleshooting AWS CodeDeploy in a Node.js Project 1. If you receive an error indicating a lack of healthy instances when using the HalfAtATime configuration: This error occurs when there are insufficient healthy instances. Verify if the health check of the target group you are deploying to is successful. Ensure that the required number of instances are healthy. 2. Check if all the necessary libraries are installed: Verify if Node.js, NVM, and o.. 2023. 5. 24.
[Jenkins] No space in device error You can use docker prune command. Deleting Docker Images Older than 3 Days $ docker system prune -af --filter "until=$((3*24))h” 2023. 5. 24.
How to Register Git Credential Key in Sourcetree Since some time ago, RSA SSH keys are no longer supported by GitHub. Therefore, if you encounter errors while using Git, follow the steps below: 1. Open Sourcetree and go to Tools > Generate or Import SSH Key. 2. Select ECDSA at the bottom. 3. Click Generate and save the public/private key. 4. In Sourcetree, go to Tools > Options > General and change the SSH key to the private key you generated... 2023. 5. 24.
[JSDoc] 유용한 주석 달기 올바른 네이밍과 가독성 좋게 코드를 작성한다면, 코드 그 자체로 모든 것이 설명되므로 주석은 불필요하다고 할 수도 있겠다. 그러나 가끔 해당 프로젝트 코드 외적인 이유를 설명해야 할 때도 있고, (이런 일이 없는 것이 더 좋긴 하겠지만) 비슷하지만 약간 다른 기능을 하는 함수가 존재하는 경우도 있을수 있다. 예를들어... 아래와 같은 경우가 있을 수 있다. 피시방에서 쓰는 프로그램을 만드는데, 내가 프론트 작업을 해야 한다. 근데 백엔드에서 데이터를 아래와 같이 보내주고 있었다. [ { id: 1, name: '10시간 이용권', count: 10, price: 10000, }, { id: 2, name: '20시간 이용권', count: 20, price: 15000, }, ]; 그런데... 피시방에서.. 2022. 9. 6.
ES Module Export (Default, Named) 모듈 시스템을 사용하는 이유는, 쪼개져있는 코드들을 효율적으로 불러다 쓰기 위해서다. module을 잘 활용하면 깔끔하고 효율적인 코드를 작성할 수 있다. Named Export - 지정된 이름을 사용하는 export - 한 파일에서 여러 객체를 export할때 사용 // exp.js export const num = 100; export const foo = (a) => a + 1; export class bar {}; // imp.js import { num, foo, bar } from './exp.js'; import시 정의된 것과 이름을 사용해야 하며, 변경을 원하는 경우 import { foo as f } 로 사용할 수 있다. 한번에 전체 export를 가져오고 싶은 경우 // imp.js i.. 2021. 9. 28.
JetBrains IDE 글자 폰트 확대하기 (Ctrl + 마우스 휠 활성화) Intelij, PyCharm, RubyMine, WebStorm 등 대부분 동일할 것 같다. File>Settings>Editor>General 최상단 Change font size with Ctrl+Mouse Wheel 체크 설정 후 Ctrl+휠로 확대/축소 할 수 있다. 맥은 아마 Cmd+휠일듯. 2021. 9. 14.