Skip to content

Instantly share code, notes, and snippets.

View hw0k's full-sized avatar
🎯

Hyunwook Nam hw0k

🎯
  • localhost
  • 05:54 (UTC +09:00)
View GitHub Profile
🌞 Morning 27 commits █████▌░░░░░░░░░░░░░░░ 26.2%
🌆 Daytime 40 commits ████████▏░░░░░░░░░░░░ 38.8%
🌃 Evening 21 commits ████▎░░░░░░░░░░░░░░░░ 20.4%
🌙 Night 15 commits ███░░░░░░░░░░░░░░░░░░ 14.6%
const path = require('path');
const fs = require('fs');
const { promisify } = require('util');
const fetch = require('node-fetch');
const OpenAPI = require('openapi-typescript-codegen');
const format = 'yaml'; // yaml or json
const specURL = 'https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml';
const outputPath = path.resolve(path.join(__dirname, '..', '__generated__'));
async function run() {
console.log('Running!');
}
run();
@hw0k
hw0k / .p10k.zsh
Last active January 25, 2021 13:15
# Generated by Powerlevel10k configuration wizard on 2021-01-25 at 21:39 KST.
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh, checksum 13301.
# Wizard options: powerline, pure, snazzy, 2 lines, sparse, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
#
# Differences from Pure:
#
# - Git:
@hw0k
hw0k / Brewfile
Last active January 21, 2021 17:11
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
brew "nodenv"
brew "watchman"
cask "notion"
cask "iterm2"
cask "google-chrome"
cask "openjdk@11"
@hw0k
hw0k / test.md
Created January 20, 2021 17:31
Test

마크다운 렌더링 테스트

123

@hw0k
hw0k / assignment.ts
Created January 18, 2021 05:32
TN 8
let value: string | number;
value = 3;
// value는 number로 추론됨.
value.toPrecision(5);
value.toFixed(5);
value = 'abc';
// value는 string으로 추론됨.
value.split('').reverse().join('');
@hw0k
hw0k / shape.ts
Created January 18, 2021 05:27
TN 7
interface Circle {
kind: 'circle';
radius: number;
}
interface Square {
kind: 'square';
sideLength: number;
}
function doSomething(left: string | number, right: string | boolean) {
if (left === right) {
// left와 right가 모두 string으로 추론됨.
console.log(left.toLowerCase());
console.log(right.toLowerCase());
return;
}
// left는 string | number, right는 string | boolean으로 추론됨.
console.log(`${left}`);
console.log(`${right}`);
interface Person {
play: () => void;
sing: () => void;
talk: () => void;
}
function playWithPerson(person: Person | undefined) {
if (!person) {
// person은 undefined로 추론됨.
throw new Error('Person not found!');