Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| #!/bin/bash | |
| #get highest tag number | |
| VERSION=`git describe --abbrev=0 --tags` | |
| #replace . with space so can split into an array | |
| VERSION_BITS=(${VERSION//./ }) | |
| #get number parts and increase last one by 1 | |
| VNUM1=${VERSION_BITS[0]} |
| import React from "react" | |
| import { Route, Switch } from "react-router-dom" | |
| const AppRoute = ({ component: Component, layout: Layout, ...rest }) => ( | |
| <Route {...rest} render={props => ( | |
| <Layout> | |
| <Component {...props} /> | |
| </Layout> | |
| )} /> | |
| ) |
| // O(1) | |
| const todo = (state, action) => { | |
| const actions = { | |
| ADD_TODO: () => { | |
| return { | |
| id: action.id, | |
| text: action.text, | |
| completed: false | |
| } | |
| }, |
| function quickSort(arr){ | |
| if(arr.length < 2) | |
| return arr; | |
| var pivot = arr[Math.floor(arr.length/2)]; | |
| var middle = arr.filter(function (data) {return data == pivot;}); | |
| var lows = quickSort(arr.filter(function (data) {return data < pivot;})); | |
| var highs = quickSort(arr.filter(function (data) {return data > pivot;})); | |
| /** | |
| 초성 중성 종성 분리 하기 | |
| 유니코드 한글은 0xAC00 으로부터 | |
| 초성 19개, 중상21개, 종성28개로 이루어지고 | |
| 이들을 조합한 11,172개의 문자를 갖는다. | |
| 한글코드의 값 = ((초성 * 21) + 중성) * 28 + 종성 + 0xAC00 | |
| (0xAC00은 'ㄱ'의 코드값) |