Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔

Lee Byonghun Tolluset

🤔
View GitHub Profile
@Tolluset
Tolluset / winningNumbers.js
Created Mar 27, 2022
Web component with shadow dom
View winningNumbers.js
import { LOTTO_COUNTS, LOTTO_NUMBERS_LIMIT, LOTTO_NUMBERS_START } from '../constants';
const template = document.createElement('template');
const makeWinningNumberInput = () => {
const inputs = [];
while (inputs.length < LOTTO_COUNTS) {
const tagString = `
<input
type="number"
@Tolluset
Tolluset / actions.yaml
Created Mar 3, 2022
when use actions for using yarn
View actions.yaml
name: node_actions_example
on: push
jobs:
job_using_node:
name: Using actions node
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@Tolluset
Tolluset / getValue.ts
Created Apr 2, 2021
Get values using generic
View getValue.ts
const getValue = <T, U extends keyof T>(obj: T, key: U): T[U] => {
return obj[key];
};
View I'm an early 🐤
🌞 Morning 104 commits ███▎░░░░░░░░░░░░░░░░░ 15.7%
🌆 Daytime 333 commits ██████████▌░░░░░░░░░░ 50.2%
🌃 Evening 169 commits █████▎░░░░░░░░░░░░░░░ 25.5%
🌙 Night 57 commits █▊░░░░░░░░░░░░░░░░░░░ 8.6%
@Tolluset
Tolluset / .gitconfig
Last active Feb 15, 2022
Git alias' config
View .gitconfig
[user]
name = tolluset
email = dlqud19@gmail.com
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[credential]
helper = osxkeychain
@Tolluset
Tolluset / decoder.ts
Created Jan 13, 2021
decoder for html by ts
View decoder.ts
const decodeHtmlEntity = function (str: string) {
return str.replace(/&#(\d+);/g, function (match: string, dec: number) {
return String.fromCharCode(dec)
})
}
const encodeHtmlEntity = function (str: string) {
const buf = []
for (let i = str.length - 1; i >= 0; i--) {
buf.unshift(['&#', str.charCodeAt(i), ';'].join(''))