| 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; | |
| } |
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๊ฐ Vue ๋ณด๋ค ๋ ์ข์๊ฐ? By John Hannah
- ๋ด(๋ฐ์ฑ๋ ฌ)๊ฐ Svelte์ ๊ด์ฌ์ ๊ฐ์ง๊ฒ ๋ ์ด์ .
- ๊ธ์ด ์ฃผ์ฅํ๋ ๋ฐ๋ ๋๋ต ์ธ ๊ฐ์ง
- ๊ตฌ๋ฌธ์ด ๊ฐ๊ฒฐํ๋ค.
- Vue๋ณด๋ค ๋น ๋ฅด๋ค(bootup time, main thread cost)
- ์ฉ๋์ด Vue๋ณด๋ค ์ ๋ค(total byte weight)
์ฐธ๊ณ ๊ธ : https://blog.jonnew.com/posts/poo-dot-length-equals-two
โ๐คโ.length() => 2
โโค๏ธโ.length() => 2
โ๐ฆโ.length() => 2
โ๐ฆ๐พโ.length() => 4
โ๐ตโโ๏ธโ.length() => 5
โ๐จโ๐ฉโ๐ฆโ๐ฆโ.length() => 11
ํ๊ธ์๋ก ์ทจ๊ธ๋ ๊ฒ ๊ฐ์ ํ๊ฐ์ ์ด๋ชจ์ง์์ ์ด๋ฐ ๊ฒฐ๊ณผ๊ฐ ๋์ค๋ ์ด์ ๋ฅผ ์ฐพ์๋ณด์์ต๋๋ค.
| /** | |
| * @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: [], |
| /** | |
| * @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: "", |
| #!/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 |
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.