Skip to content

Instantly share code, notes, and snippets.

View hyunbinseo's full-sized avatar

Hyunbin Seo hyunbinseo

View GitHub Profile
@hyunbinseo
hyunbinseo / ssh.bash
Last active May 5, 2025 18:25
Setup SSH (macOS, YubiKey FIDO)
# Moved to https://github.com/hyunbinseo/blog/blob/master/posts/setup-ssh.md
### Preparation ###############################################################
# macOS bundled OpenSSH does not support FIDO.
# https://developer.apple.com/forums/thread/698683
# https://github.com/apple-oss-distributions/OpenSSH/pull/1
brew install openssh
@hyunbinseo
hyunbinseo / footnote.md
Created February 18, 2023 10:03
Alphabet footnotes converted to linear numeric footer

그들의 피고, 황금시대를 목숨을 것이다.1

얼마나 그들에게 대한 군영과 것이다.2

Footnotes

  1. 보라, 대고, 용감하고 가지에 옷을 힘있다.

  2. 보라, 보이는 노년에게서 못할 청춘은 아니다.

@hyunbinseo
hyunbinseo / eleventy-upgrade-help.log
Created February 10, 2023 12:33
11ty upgrade helper log
[@11ty/eleventy-upgrade-help] ---
[@11ty/eleventy-upgrade-help] This plugin will help you migrate from 1.0 to 2.0.
[@11ty/eleventy-upgrade-help] If you are migrating from 0.x, downgrade to the 1.0 version of this plugin!
[@11ty/eleventy-upgrade-help] ---
[@11ty/eleventy-upgrade-help] PASSED This project is not using the previously deprecated and disabled by default `dataTemplateEngine` configuration property. Read more at https://www.11ty.dev/docs/data-preprocessing/
[@11ty/eleventy-upgrade-help] PASSED This project is not using the `--passthroughall` command line flag. Read more at https://www.11ty.dev/docs/copy/#passthrough-everything
[@11ty/eleventy-upgrade-help] NOTICE The `liquidjs` dependency was updated from 9.x to 10.x. This should not require action, but you can read the full release notes: https://github.com/harttle/liquidjs/releases/tag/v10.0.0
[@11ty/eleventy-upgrade-help] NOTICE Markdown’s indented code blocks have been disabled by default in 2.0. Unfortunately, this plugin does *NOT* currently t
@hyunbinseo
hyunbinseo / dom-focus-lock.ts
Created January 15, 2023 14:07
Lock focus on modal elements, TypeScript
const tabIndexGuard = (el: Element): el is HTMLElement => (el as HTMLElement).tabIndex >= 0;
// Based on https://svelte.dev/examples/modal
export const focusLock = (e: KeyboardEvent, el: HTMLElement) => {
if (e.key === 'Tab') {
// trap focus
const nodes = el.querySelectorAll('*');
const tabbable = Array.from(nodes).filter(tabIndexGuard);
let index = tabbable.indexOf(document.activeElement as HTMLElement);
@hyunbinseo
hyunbinseo / settings.json
Last active March 24, 2025 12:45
VS Code Settings
{
"[csv]": {
"files.encoding": "utf8bom"
},
"[markdown]": {
"editor.fontFamily": "'엘리스 디지털코딩체 ver.H', 'Elice DigitalCoding OTF', monospace",
"prettier.tabWidth": 2,
"prettier.useTabs": false
},
"[svelte]": {
@hyunbinseo
hyunbinseo / ie-error-page.html
Created September 6, 2022 01:30
Internet Explorer Error Page
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="NewErrorPageTemplate.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>이 페이지에 연결할 수 없음</title>
<script src="errorPageStrings.js" language="javascript" type="text/javascript">
</script>
<script src="httpErrorPagesScripts.js" language="javascript" type="text/javascript">
@hyunbinseo
hyunbinseo / .vscode\tasks.json
Created August 18, 2022 09:37
Run currently opened .ts file in VS Code
{
// Steps
// 1. Open workspace in the Visual Studio Code
// 2. Install 'esno' (https://www.npmjs.com/package/esno)
// 3. Create a '.vscode/tasks.json' file
// 4. Open a TypeScript file
// 5. Press 'Ctrl + Shift + B' (run build task)
"version": "2.0.0",
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
@hyunbinseo
hyunbinseo / puppeteer.js
Created July 23, 2022 06:50
Convert multiple URLs into PDF using puppeteer
const puppeteer = require('puppeteer'); // [email protected]
const urls = [
'https://en.wikipedia.org/wiki/TypeScript',
'https://en.wikipedia.org/wiki/JavaScript',
];
const urlCount = urls.length;
const delay = 5000; // Delay between each save
@hyunbinseo
hyunbinseo / colorthief.js
Created April 19, 2022 01:03
Get dominant color from images in RGB or HEX
// https://github.com/lokesh/color-thief
const ColorThief = require('colorthief');
// Preferences
const directory = './images';
const extension = 'jpg';
const filenames = [
'loon-yyy-riven',
'dining-agreed-gumball',
'cowan-logs-bagged',
@hyunbinseo
hyunbinseo / layout.html
Last active June 16, 2022 08:40
Unsupported browser page for Internet Explorer
<!DOCTYPE html>
<html lang="en">
<head>
<script>
// Check if the client is Internet Explorer.
if (/MSIE|Trident/.test(window.navigator.userAgent))
// In Cloudflare Pages trim .html from the URL
// It is not supported in older versions of IE
// Can be reproduced in version 11.0.9600.18860