Skip to content

Instantly share code, notes, and snippets.

View leegeunhyeok's full-sized avatar
🎯
Focusing

Geunhyeok LEE leegeunhyeok

🎯
Focusing
View GitHub Profile
@leegeunhyeok
leegeunhyeok / hhkb-layout.json
Created January 15, 2026 15:16
Oblique 60 Setups
{
"name": "Oblique60",
"vendorProductId": 1329725536,
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_1",
"KC_2",
"KC_3",
@leegeunhyeok
leegeunhyeok / index.js
Created December 17, 2025 18:36
Hermes V1 (250829098.0.4) Block Scoping Test
const values = ['a', 'b', 'c'];
const captures = {};
for (let i = 0; i < values.length; i++) {
const value = values[i];
captures[value] = () => {
console.log(value);
};
}
const globalMachine = Machine(
{
predictableActionArguments: true,
initial: 'idle',
context: {
user: null,
},
states: {
@leegeunhyeok
leegeunhyeok / machine.js
Last active January 28, 2023 17:52
Generated by XState Viz: https://xstate.js.org/viz
const TAG = 'GlobalMachine';
const AsyncStorage = localStorage;
Machine(
{
id: TAG,
initial: 'idle',
context: {
user: null,
},
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export TERM=xterm-256color
unsetopt nomatch
# Set name of the theme to load --- if set to "random", it will
@leegeunhyeok
leegeunhyeok / ghlee.itermcolors
Last active December 19, 2023 07:27
My iTerm2 profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@leegeunhyeok
leegeunhyeok / example.tsx
Last active May 6, 2021 17:41
Awesome Logger for React.Profiler
<Profiler id="MyComponent" onRender={console.profile}>
<Component />
</Profiler>
@leegeunhyeok
leegeunhyeok / eval_only_once.js
Created October 8, 2020 05:23
Eval only once
let init = false;
const doSomething = () => {
if (!init && (init = true)) {
console.log('Only once');
return;
}
console.log('Do something');
}
doSomething(); // Only once
@leegeunhyeok
leegeunhyeok / get_week_number.js
Created October 8, 2020 04:06
📅 특정 날짜 기준으로 당월 N주차 구하기
/**
* 특정 날짜 기준으로 당월 N주차 구하기
* @author dev.ghlee@gmail.com
*/
/**
* 지정된 날짜가 몇 주차인지 계산하여 반환합니다
* @param {Date} dateFrom 주차 계산을 위한 기준 날짜
*/
@leegeunhyeok
leegeunhyeok / pick.js
Last active August 3, 2020 06:40
[출간기념 이벤트] SNS 앱으로 배우는 프로그레시브 웹 앱 - 페이스북 생활코딩 추첨
const PICK = 5; // 추첨 인원
const picked = {}; // 중복 추첨 방지 확인용 객체
const commentCount = $0.childElementCount // 전체 댓글 수
const users = Array.from($0.children).map((comment) => comment.querySelector('[aria-label="Comment"]'));
for (let i = 0; i < PICK; i++) {
let idx = Math.floor(Math.random() * commentCount);
while (picked[idx]) {
idx = Math.floor(Math.random() * commentCount);
}