Skip to content

Instantly share code, notes, and snippets.

@tolluset
tolluset / decoder.ts
Created January 13, 2021 14:19
decoder for html by 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(''))
🌞 Morning 104 commits ███▎░░░░░░░░░░░░░░░░░ 15.7%
🌆 Daytime 333 commits ██████████▌░░░░░░░░░░ 50.2%
🌃 Evening 169 commits █████▎░░░░░░░░░░░░░░░ 25.5%
🌙 Night 57 commits █▊░░░░░░░░░░░░░░░░░░░ 8.6%
@tolluset
tolluset / getValue.ts
Created April 2, 2021 02:41
Get values using generic
const getValue = <T, U extends keyof T>(obj: T, key: U): T[U] => {
return obj[key];
};
@tolluset
tolluset / actions.yaml
Created March 3, 2022 21:51
when use actions for using yarn
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 / winningNumbers.js
Created March 27, 2022 14:12
Web component with shadow dom
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"
[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
# .config/alacritty/alacritty.yml
font:
size: 11
normal:
family: MesloLGS NF
bold:
family: MesloLGS NF
italic:
family: MesloLGS NF
bold_italic: