Skip to content

Instantly share code, notes, and snippets.

@ysm-dev
ysm-dev / index.ts
Last active July 9, 2024 05:23
Text(string) to CID (v1) TypeScript
import { CID } from "multiformats/cid";
import * as raw from "multiformats/codecs/raw";
import { sha256 } from "@noble/hashes/sha256";
import { create } from "multiformats/hashes/digest";
export const toCID = (txt: string) => {
return CID.createV1(raw.code, create(0x12, sha256(txt))).toString();
};
@ysm-dev
ysm-dev / test-markdown.md
Last active January 20, 2020 09:02
test-markdown

Welcome to JSConf Korea!

About

Welcome to the very first Korean edition of JSConf!

JSConf Korea is a community conference that pushes the boundaries of what can be created using JavaScript, and an opportunity for people with diverse experiences to share their stories and positive energy with each other.

Our mission is to make the Korean technology community more daring, more diverse, and more human; in short, we just want to make things better.

@ysm-dev
ysm-dev / test.md
Last active January 18, 2020 15:57
test-markdown

StackEdit markdown test

StackEdit markdown Test 입니다 fg

@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:25
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<picture>
<img
src="/some/man-with-a-dog.jpg"
alt="Man with a dog"
style="object-fit: cover;"
/>
</picture>
<!-- The new way -->
@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:25
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<div
style="background-image: url('/some/man-with-a-dog.jpg');
background-size: cover;"
></div>
<!-- The old way -->
@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:25
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<picture>
<source
srcset="
/some/_1170x658_crop_center-center/man-with-a-dog.webp 1170w,
/some/_970x545_crop_center-center/man-with-a-dog.webp 970w,
/some/_750x562_crop_center-center/man-with-a-dog.webp 750w,
/some/_320x240_crop_center-center/man-with-a-dog.webp 320w
"
sizes="100vw"
type="image/webp"
@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:23
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<picture>
<img
src="/some/man-with-a-dog.jpg"
alt="Man with a dog"
style="object-fit: cover;"
/>
</picture>
<!-- The new way -->
@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:23
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<picture>
<source
srcset="
/some/_1170x658_crop_center-center/man-with-a-dog.webp 1170w,
/some/_970x545_crop_center-center/man-with-a-dog.webp 970w,
/some/_750x562_crop_center-center/man-with-a-dog.webp 750w,
/some/_320x240_crop_center-center/man-with-a-dog.webp 320w
"
sizes="100vw"
type="image/webp"
@ysm-dev
ysm-dev / Markdium-HTML.html
Created August 28, 2019 06:23
Markdium-🚫 안티 패턴으로서의 CSS background-image 속성
<div
style="background-image: url('/some/man-with-a-dog.jpg');
background-size: cover;"
></div>
<!-- The old way -->
@ysm-dev
ysm-dev / Markdium-Shell.sh
Created August 3, 2019 15:22
Markdium-▶️ Github Actions에 추가된 schedule 기능으로 Crontab 대체하기
$ node index.js