Skip to content

Instantly share code, notes, and snippets.

View kyh196201's full-sized avatar
🐢
Slow and steady

Seungwoo Kim kyh196201

🐢
Slow and steady
View GitHub Profile
@dannberg
dannberg / obsidian-daily-note-template.txt
Last active November 18, 2024 02:59
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
---
created: <% tp.file.creation_date() %>
---
tags:: [[+Daily Notes]]
# <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %>
<< [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|Tomorrow]] >>
---
@szemate
szemate / package-lock-conflicts.md
Last active August 29, 2024 10:39
How to resolve package-lock.json conflicts

How to resolve package-lock.json conflicts

It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

  1. Update the master branch with the latest changes:
    git checkout master
    git pull
    
  2. Merge your feature branch into master:
@JimYaaa
JimYaaa / vue.js
Last active November 26, 2021 09:02
Vue Recursive Component Emit
// Parent Component
<template>
<div>
<parent-recursive-component @recursiveEmit="recursiveEmit" />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import ParentRecursiveComponent from './RecursiveComponent'
@wobsoriano
wobsoriano / App.vue
Last active November 23, 2022 17:13
Vue 3 Infinite Scroll Component
<script setup lang="ts">
import { ref } from 'vue';
import InfiniteScroll from '~/components/InfiniteScroll.vue';
import SkeletonPostItem from '~/components/SkeletonPostItem.vue';
interface State {
loaded: () => void;
complete: () => void;
}
@karpolan
karpolan / .prettierrc.js
Last active September 13, 2024 20:14
Prettier config for React App
module.exports = {
printWidth: 120, // max 120 chars in line, code is easy to read
useTabs: false, // use spaces instead of tabs
tabWidth: 2, // "visual width" of of the "tab"
trailingComma: 'es5', // add trailing commas in objects, arrays, etc.
semi: true, // add ; when needed
singleQuote: true, // '' for stings instead of ""
bracketSpacing: true, // import { some } ... instead of import {some} ...
arrowParens: 'always', // braces even for single param in arrow functions (a) => { }
jsxSingleQuote: false, // "" for react props, like in html
@cathrinevaage
cathrinevaage / App.vue
Last active July 5, 2024 15:21
Tabs in Vue 3 / Composition API
<!-- Usage -->
<template>
<Tabs>
<Tab name="Foo">Content of tab Foo</Tab>
<Tab name="Bar">Content of tab Bar</Tab>
</Tabs>
</template>
<script>

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.

@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
@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: "",
@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

한글자로 취급될 것 같은 한개의 이모지에서 이런 결과가 나오는 이유를 찾아보았습니다.