본문 바로가기

getting_started61

[TypeScript] Basic Types TypeScript gives us some data types and it helps us a lot. Boolean It has a true/false value. let isSuccess: boolean = true; Number let binary: number = 0b0111; let octal: number = 0o765; let decimal: number = 7; let hex: number = 0xcafe; let big: bigint = 1234n; If you want to use bigint, you need to use ES2020 or later. String let familyName: string = 'kim' let givenName: string = "hoya" let m.. 2021. 7. 4.
[Vue3] Getting Started with Vue3 + Electron (with Typescript, TailwindCSS) Let's make a desktop application using Vue3. Create a Project using Vue-CLI $ vue create vue-electron Select "Manually select features" for some options. I picked TypeScript, Router, and Vuex. I will use Vue3. And, I will use ESLint with Prettier. Lastly, I will use dedicated config files for easier management. $ cd vue-electron Now, we have our project. Adding Electron Now, let's add Electron t.. 2021. 6. 28.
[Vue3] Getting Started with Vue3 + TypeScript + TailwindCSS In this posting, we will learn how to start with Vue3 + TypeScript + TailwindCSS. Prerequisite I will use the Vue CLI, so let's install it first. $ yarn global add @vue/cli Create a Project Once installed, let's create the project. $ vue create If you want to start with the default setting, just choose it. But, I will start with manual configuration for using TypeScript at this time. Select a Ty.. 2021. 6. 2.
[Flask] Using Markdown on Flask In this posting, I'll show you how to use markdown on Flask. Installation $ pip install flask flask-markdown flask-simplemde Install Flask and Flask-Markdown, Flask-SimpleMDE. Create an Application 2020/10/11 - [Python] - [Python] Getting Started with Flask app.py from flask import Flask, render_template app = Flask(__name__) @app.route("/") def index(): return render_template("index.html") if _.. 2021. 3. 1.
Draw Graph with MatPlotLib in Python matplotlib is used for data visualization in Python. Especially, this library is lively used in data engineering. Installation If you want to locally install this library, you can use pip. $ pip install matplotlib I will use Google's Colab for further posting. Requirements import numpy as np import matplotlib.pyplot as plt from PIL import Image import cv2 %matplotlib inline I will use those pack.. 2021. 2. 25.
[PyCharm] Run Flask Application on PyCharm In this posting, I explain how to run the Flask application on PyCharm. Installation On Mac I used the HomeBrew for installation. $ brew insstall --cask pycharm-ce On Windows I used the Chocolatey for installation. $ choco install -y pycharm-community Flask Application Let's make a very simple application for testing. from flask import Flask app = Flask(__name__) @app.route('/') def hello(): ret.. 2021. 1. 26.
[Next] Getting Started (with TypeScript, TailwindCSS) Next is an awesome framework. The homepage represents "The React Framework for Production" as its motto. It supports TypeScript with React. In addition, it also supports easy SSR, zero-configuration, SEO friendly, and routing based on the folder structure. Now, let's start !! Create a Project $ npx create-next-app my_next_app --example with-typescript $ cd my_next_app $ yarn dev Now, access our .. 2021. 1. 9.
[Jest] Testing with Error Return Source Code Let's create a function to test. const funcWithError = (): void => { throw new Error("My Error") } Test Code Now, let's test our function. describe("Test With Error", () => { it("tests a function with an error return", () => { try { calculator.funcWithError(); } catch (err) { expect(err).toEqual(new Error("My Error")); } }); }); I tested with a try...catch statement. Yay~ It works we.. 2020. 12. 28.
[React] Get Keyboard Input (TypeScript) Recently, I wanted to get keyboard input on the React application. I thought there is maybe someone like me. So let's figure out this. Create a Test Project $ npx create-react-app react-test --template typescript Implement I tried many things to implement this. Like onKeyDown, onKeyPress in div tag or, addEventListener to window or document in useEffect. Finally, I found the key point !! import .. 2020. 12. 28.
[Windows] Getting Started with Windows Terminal I like a Windows Terminal as terminal on Windows. I had waited it since I found out, and I've been using it since beta. If you don't use it now, try it out. You will like it like me. Installation I use chocolatey for package manager Windows. 2020/08/30 - [OS/Windows] - [Windows] Chocolatey $ choco install microsoft-windows-terminal --pre Now, run the Windows Terminal. $ wt Usage Click the down a.. 2020. 12. 24.
[Go] User-Defined Type Primitive Type based User-Defined Type type liters float64 type gallons float64 func main() { gasoline := liters(12.5) diesel := gallons(32.7) fmt.Println(gasoline, diesel) // 12.5 32.7 } You can create your own type based on primitive type. When converting a type, Go considers only the value itself. fmt.Println(gallons(liters(3.14))) // 3.14 So this example is not wrong, because they are all th.. 2020. 11. 2.
[Go] Basic Go is a statically typed language. Let me show you a very default Go program. package main import "fmt" func main() { fmt.Println("Hello, Go!") } The first line declares which package to use. We run the program directly in the terminal, so the main package is needed. The next line imports fmt package. The example program prints the message through Println function in the fmt package. Then finall.. 2020. 10. 26.