Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Growing

배하람 baeharam

🤔
Growing
View GitHub Profile
View machine.js
const INACTIVE = '비활성화';
const ACTIVE = '활성화';
const DELETE_PENDING = '삭제로딩';
const DELETE_SUCCESS = '삭제성공';
const DELETE_FAILURE = '삭제실패';
// Events
const TYPE = '입력';
const DELETE = '삭제';
View machine.js
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
View machine.js
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 / bfs.js
Created Oct 31, 2019
BFS implementation
View bfs.js
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 Aug 12, 2019 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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 Mar 17, 2019
My Dirty Tetris
View tetris.c
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <conio.h> // 비표준 함수 kbhit()와 getch()를 위한 헤더파일
#include <time.h> // Sleep(시간)함수를 위한 헤더파일
// 참 거짓
#define TRUE 1
#define FALSE 0
View card.dart
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"),
View main.dart
class SortedCollection {
Function compare;
SortedCollection(int f(Object a, Object b)) {
compare = f;
}
}
// Initial, broken implementation.
int sort(Object a, Object b) => 0;
View main.dart
typedef Compare = int Function(Object a, Object b);
class SortedCollection {
Compare compare;
SortedCollection(this.compare);
}
// Initial, broken implementation.
int sort(Object a, Object b) => 0;
You can’t perform that action at this time.