Skip to content

Instantly share code, notes, and snippets.

@baeharam
baeharam / machine.js
Last active September 24, 2020 07:16
Generated by XState Viz: https://xstate.js.org/viz
const IDLE = '기본';
const MOVE_MODE = '이동 모드';
const TYPE_MODE = '입력 모드';
const ENTER_FROM_MOVE_MODE = '이동모드에서 엔터';
const ENTER_FROM_TYPE_MODE = '입력모드에서 엔터';
const TAB = '탭';
const FOCUS = '포커스';
const BLUR = '블러';
const DOUBLE_CLICK = '더블클릭';
@baeharam
baeharam / machine.js
Last active July 15, 2020 07:05
Generated by XState Viz: https://xstate.js.org/viz
const INACTIVE = '비활성화';
const ACTIVE = '활성화';
const DELETE_PENDING = '삭제로딩';
const DELETE_SUCCESS = '삭제성공';
const DELETE_FAILURE = '삭제실패';
// Events
const TYPE = '입력';
const DELETE = '삭제';
@baeharam
baeharam / machine.js
Last active July 24, 2020 08:51
Generated by XState Viz: https://xstate.js.org/viz
const IDLE = '초기';
const INPUT_FOCUS = '인풋 포커스';
const SEARCH_PENDING = '검색 로딩';
const SEARCH_NOTHING_CAN_CREATE = '검색결과 없음, 생성가능';
const SEARCH_NOTHING_CANNOT_CREATE = '검색결과 없음, 생성불가';
const SEARCH_RESULT_CAN_CREATE = '검색결과 있음, 생성 가능';
const SEARCH_RESULT_CANNOT_CREATE = '검색결과 있음, 생성 가능';
const SEARCH_FAILURE = '검색실패'
// Events
@baeharam
baeharam / machine.js
Last active July 21, 2020 05:56
Generated by XState Viz: https://xstate.js.org/viz
const IDLE = '기본';
const PREVIEW_PENDING = '미리보기 로딩';
const PREVIEW_SUCCESS = '미리보기 성공';
const PREVIEW_FAILURE = '미리보기 실패';
const MIGRATE_PENDING = '품목추가 로딩';
const MIGRATE_SUCCESS = '품목추가 성공';
const MIGRATE_FAILURE = '품목추가 실패';
const FOCUS_WITH_RESULT = '결과나오고 포커스';
const EVENT_TYPE = '시트 아이디 입력';
@baeharam
baeharam / bfc-solve-margin-collapsing.markdown
Created February 26, 2020 03:13
BFC - Solve Margin Collapsing
@baeharam
baeharam / bfs.js
Created October 31, 2019 12:52
BFS implementation
const paintAdjcent = (x, y, tableData) => {
const queue = [];
const row = tableData.length, col = tableData[0].length;
const visited = new Array(row).fill();
visited.forEach((_, idx) => { visited[idx] = new Array(col).fill(false); });
visited[x][y] = true;
queue.push({x: x,y: y});
while(typeof queue !== 'undefined' && queue.length > 0) {
const front = queue.shift();
@baeharam
baeharam / what-forces-layout.md
Created August 12, 2019 13:26 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@baeharam
baeharam / tetris.c
Created March 17, 2019 15:00
My Dirty Tetris
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <conio.h> // 비표준 함수 kbhit()와 getch()를 위한 헤더파일
#include <time.h> // Sleep(시간)함수를 위한 헤더파일
// 참 거짓
#define TRUE 1
#define FALSE 0
@baeharam
baeharam / card.dart
Last active July 13, 2018 03:43
card
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(home: MyApp()));
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Card"),
@baeharam
baeharam / main.dart
Created July 10, 2018 04:29
typdeferror
class SortedCollection {
Function compare;
SortedCollection(int f(Object a, Object b)) {
compare = f;
}
}
// Initial, broken implementation.
int sort(Object a, Object b) => 0;