Skip to content

Instantly share code, notes, and snippets.

View kyh196201's full-sized avatar
๐Ÿฃ
Hi

Seungwoo Kim kyh196201

๐Ÿฃ
Hi
View GitHub Profile
@iannbing
iannbing / ._reactFormatting
Last active November 15, 2022 17:04
A gist for initial eslint and prettier setup for React projects
We couldnโ€™t find that file to show.
@devloco
devloco / download-pdf.js
Last active December 2, 2024 04:14
Download a PDF via POST with Fetch API
let fnGetFileNameFromContentDispostionHeader = function (header) {
let contentDispostion = header.split(';');
const fileNameToken = `filename*=UTF-8''`;
let fileName = 'downloaded.pdf';
for (let thisValue of contentDispostion) {
if (thisValue.trim().indexOf(fileNameToken) === 0) {
fileName = decodeURIComponent(thisValue.trim().replace(fileNameToken, ''));
break;
}
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active December 26, 2025 19:04
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

<template>
<div>
<div v-for="user in users" :key="user.id">
<user-profile-modal
:show="showModal(user.id)"
@close="toggleModal(user.id)" />
<a class="text-sm" href="#" @click.stop="toggleModal(user.id)">Show</a>
</div>
</div>

Svelte.js

์™œ svelte๊ฐ€ Vue ๋ณด๋‹ค ๋” ์ข‹์€๊ฐ€? By John Hannah

  • ๋‚ด(๋ฐ•์„ฑ๋ ฌ)๊ฐ€ Svelte์— ๊ด€์‹ฌ์„ ๊ฐ€์ง€๊ฒŒ ๋œ ์ด์œ .
  • ๊ธ€์ด ์ฃผ์žฅํ•˜๋Š” ๋ฐ”๋Š” ๋Œ€๋žต ์„ธ ๊ฐ€์ง€
    • ๊ตฌ๋ฌธ์ด ๊ฐ„๊ฒฐํ•˜๋‹ค.
    • Vue๋ณด๋‹ค ๋น ๋ฅด๋‹ค(bootup time, main thread cost)
    • ์šฉ๋Ÿ‰์ด Vue๋ณด๋‹ค ์ ๋‹ค(total byte weight)
@silverprize
silverprize / emoji-unicode.md
Last active February 23, 2024 00:36
Emoji on Unicode

์ฐธ๊ณ ๊ธ€ : https://blog.jonnew.com/posts/poo-dot-length-equals-two

โ€œ๐Ÿ–คโ€.length() => 2
โ€œโค๏ธโ€.length() => 2
โ€œ๐Ÿ‘ฆโ€.length() => 2
โ€œ๐Ÿ‘ฆ๐Ÿพโ€.length() => 4
โ€œ๐Ÿšตโ€โ™€๏ธโ€.length() => 5
โ€œ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆโ€.length() => 11

ํ•œ๊ธ€์ž๋กœ ์ทจ๊ธ‰๋  ๊ฒƒ ๊ฐ™์€ ํ•œ๊ฐœ์˜ ์ด๋ชจ์ง€์—์„œ ์ด๋Ÿฐ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค๋Š” ์ด์œ ๋ฅผ ์ฐพ์•„๋ณด์•˜์Šต๋‹ˆ๋‹ค.

@Jonarod
Jonarod / CheckBox.vue
Created November 23, 2019 18:20
Simple custom CheckBox component for Vue.js, compatible with v-model.
/**
* @usage:
*
* <CheckBox label="Foo" value="foo" v-model="MySelectedValues" />
* <CheckBox label="Bar" value="bar" v-model="MySelectedValues" />
* <CheckBox label="Baz" value="baz" v-model="MySelectedValues" />
*
* data(){
* return {
* MySelectedValues: [],
@Jonarod
Jonarod / RadioBox.vue
Created November 23, 2019 18:23
Simple custom Radio component for Vue.js, compatible with v-model.
/**
* @usage:
*
* <RadioBox label="Foo" value="foo" v-model="MySelectedValue" />
* <RadioBox label="Bar" value="bar" v-model="MySelectedValue" />
* <RadioBox label="Baz" value="baz" v-model="MySelectedValue" />
*
* data(){
* return {
* MySelectedValue: "",
@raduchiriac
raduchiriac / prepare-commit-msg
Last active September 3, 2024 06:13
Hook: Prepend Jira ticket ID to the git commit message
#!/bin/bash
# Get the current branch name
current_branch=`git rev-parse --abbrev-ref HEAD`
# Search Jira ID in a pattern such a "feature/ABCD-123-my-feature"
id=$(echo $current_branch | sed -nE 's,[a-z]+/([A-Z]+-[0-9]+)-.+,\1,p')
# only prepare commit message if pattern matched and jiraId was found
if [[ ! -z $id ]]; then

Boolean() or !! (double bang, double negation)?

What's the best way to answer the question "true or false?" in JavaScript

JavaScript does not bother you too much with types (at first), which is both a blessing and a cure. But we all know the Boolean type. Boolean variables can either be true or false. Yes or no.

Every value in JavaScript can be translated into a boolean, true or false. Values that translate to true are truthy, values that translate to false are falsy. Simple.

This is about two ways to make that translation.