2020幎11æ1é± Weekly Report
ð° Topics
æ°ããããšãã¢ãŠãããã/ã€ã³ãããããã©ã³ã¹ããã§ããäžé±éã§ããã
ä¹
ã
ã«Webããã³ããšã³ããã¬ãããªè§ŠããTogowlããªãªãŒã¹ããŠããŸãã
Table of Contents
æžããããš
JetBrains IDEãVS Codeã§ã䜿ãã10ã®Vimãã©ã°ã€ã³
ç§ã¯å®è·µVimã®å€§ãã¡ã³ã§ãã
ããã©ã«ããæããæž
æžãèªãã ããšããã®å
ã«ããè³é«ã®Vimmerãç®æãããã«æžããŸããã
ãã®èšäºã§ã¯ãçŸå®çåŸãããçç£æ§ãšã¡ã³ãã³ã¹ãã®èœãšãã©ããã暡玢ããŸããã
ãã®äžã§äœ¿ã£ãæ¹ããããšå€æãã10ã®ãã©ã°ã€ã³ã玹ä»ããŠããŸãã
æ¯éãå®è·µVimãèªãã§ã¿ãŠãã ãã..!!
å®è·µVim æèã®ã¹ããŒãã§ç·šéãããïŒãé»åæžç±ã[ DrewãNeil ] |
ãGitãtigã®ã€ã³ã¹ããŒã«æ¹æ³
ã¿ãŒããã«ã§åã察話ågitã¯ã©ã€ã¢ã³ãtigã®ã€ã³ã¹ããŒã«æ¹æ³ãç°¡æœã«ãŸãšããŸããã
åèŠã ãšèŠéãããããã«ããã€ãæå察å¿ããŒãžã§ã³ãèšèŒããŠããŸãã
åŠãã ããš
DNSã®åå解決ã«ã€ããŠèª¿ã¹ãæ¹æ³
åå解決ã«é¢ãããã©ãã«..ãã®å Žåãã§ãªããšãªã察åŠããŠããŸãããããã®æ©äŒã«ãã䜿ãã³ãã³ãã ãæŽçããŠã¿ãŸããã
çµæã ãã«èå³ãããšã
nslookup
ã䜿ãã®ãããããã§ãã
Windowsã§ãLinuxã§ãããã©ã«ãã§äœ¿ããã®ã匷ã¿ã§ããã
$ nslookup blog.mamansoft.net
Server: 172.24.192.1
Address: 172.24.192.1#53
Non-authoritative answer:
blog.mamansoft.net canonical name = modest-turing-f3415c.netlify.com.
Name: modest-turing-f3415c.netlify.com
Address: 157.230.37.202
Name: modest-turing-f3415c.netlify.com
Address: 157.230.35.153
Name: modest-turing-f3415c.netlify.com
Address: 2400:6180:0:d1::4df:d001
Name: modest-turing-f3415c.netlify.com
Address: 2400:6180:0:d1::57a:6001
DNSãµãŒãããè¿åŽããã詳现æ å ±ãç¥ããããšã
dig
ã䜿ãã®ãããããã§ãã
å©çšããããã«ã¯ã€ã³ã¹ããŒã«ããå¿
èŠãããããã
$ dig blog.mamansoft.net
; <<>> DiG 9.16.1-Ubuntu <<>> blog.mamansoft.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61611
;; flags: qr rd ad; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;blog.mamansoft.net. IN A
;; ANSWER SECTION:
blog.mamansoft.net. 0 IN CNAME modest-turing-f3415c.netlify.com.
modest-turing-f3415c.netlify.com. 0 IN A 157.230.37.202
modest-turing-f3415c.netlify.com. 0 IN A 157.230.35.153
;; Query time: 20 msec
;; SERVER: 172.24.192.1#53(172.24.192.1)
;; WHEN: Tue Nov 03 20:05:39 JST 2020
;; MSG SIZE rcvd: 164
åå解決ãµãŒãå士ã®è©³çŽ°ãè¿œãããå Žåã¯+trace
ãªãã·ã§ã³ãä»ããŸãã
$ dig blog.mamansoft.net +trace
; <<>> DiG 9.16.1-Ubuntu <<>> blog.mamansoft.net +trace
;; global options: +cmd
. 469996 IN NS e.root-servers.net.
. 469996 IN NS f.root-servers.net.
---- -------------- äžç¥ ------------------------
. 469996 IN NS c.root-servers.net.
. 469996 IN NS d.root-servers.net.
;; Received 811 bytes from 172.24.192.1#53(172.24.192.1) in 860 ms
net. 172800 IN NS i.gtld-servers.net.
net. 172800 IN NS e.gtld-servers.net.
---- -------------- äžç¥ ------------------------
net. 172800 IN NS g.gtld-servers.net.
net. 86400 IN DS 35886 8 2 7862B27F5F516EBE19680444D4CE5E762981931842C465F00236401D 8BD973EE
net. 86400 IN RRSIG DS 8 1 86400 20201116050000 20201103040000 26116 . kl+yKFOz23cE+eBETpDNRCIiajYJr8UUppc6cPtfRc5gGstjCHQPxbuu 7Si2bS3g/1z3Xyfv0NJLzzLV9tW5XCPTP5z2hoI7jKtmx81KR3MBOkMt FVKlU7UOfvJsHceMqb8p2x7lNVaebkn/rEjMpdnmDhIrdwUuil5QhG0y X3ascnXcNQLqnp7MCDZLLTjOU9sO3bn5P2toiIYcJs0GKvJCE6OK7AM/ S7d5cGb3ADjKwWIDEz3cnuPFs8xp3XimCXHcEkhcrUW50b2Aw3jh64bF b8Qz9wNkUGmeuFjDbz2Yhd6PqtbA9pRlqfqs6iHvWc9alzLeq0kOrJTD 5xjMJg==
;; Received 1175 bytes from 202.12.27.33#53(m.root-servers.net) in 50 ms
mamansoft.net. 172800 IN NS dns01.muumuu-domain.com.
mamansoft.net. 172800 IN NS dns02.muumuu-domain.com.
---- -------------- äžç¥ ------------------------
;; Received 653 bytes from 192.12.94.30#53(e.gtld-servers.net) in 120 ms
blog.mamansoft.net. 3600 IN CNAME modest-turing-f3415c.netlify.com.
;; Received 93 bytes from 202.239.23.40#53(dns01.muumuu-domain.com) in 70 ms
èŠæ¹ã¯ä»¥äžã®ãµã€ããªã©ã§èª¬æãããŠããŸãã
Brotli
gzipã«å€ããå§çž®æ¹åŒã§ããBrotliãåããŠç¥ããŸããã
ãã£ããã¯Netlifyã®ã³ã³ãã³ããgzipãããªãåå ã調æ»ããŠãããšãã«èŠã€ããããŒãžã
ãã..Brotliã䜿ãããŠããããšãæå³ãããã§ããã
x-content-encoding: br
Chrome Dev Toolsã®Networkã¿ããèŠããšãå§çž®åŸãšå§çž®åã®ãµã€ãºã確èªã§ããŸãã
Web Share API
ã¹ãããã¿ãã¬ããã§äœ¿çšããå
±æ
æ©èœãå®çŸããAPIã§ãã
ã¹ããŒã¿ã¹ã¯ãŸã ãã©ãããªã®ã§ä»æ§ããæ¶ããå¯èœæ§ã¯ãããŸãããAndroid ChromeãšiOS Safariã察å¿ããŠããããçŸæç¹ã§ã¯ããªãæçšã§ãã
åæ§ã®æ©èœãå®çŸããã¯ãªããããŒãåšãã®APIãã¢ãã€ã«ã ãšèª²é¡å±±ç©ã¿ãšãªã£ãŠãããããã¢ãã€ã«ã®å
±ææ¹æ³ãšããŠã¯éåžžã«æåŸ
ããŠããŸãã
以äžã¯canvasã®ããŒã¿ãblobã«å€æããpngãšããŠå ±æããã³ãŒãã§ãã
canvas.toBlob(async (blob: Blob | null) => {
if (!blob) {
showError("Fail to capture a daily calendar.");
return;
}
const image = new File(
[blob],
`${state.currentDate.displayDate}.png`,
{
type: "image/png",
}
);
try {
await (navigator as any).share({
files: [image],
});
showSuccess(`Success to capture a daily calendar.`);
} catch (e) {
showError(`Fail to capture a daily calendar. ${e}`);
}
});
share
é¢æ°ã«ã¯files
ãæå®ããŠããŸãããããã¯å
ã®MDNã«èšèŒãããŠããªãä»æ§ã§ãã
ããã¯æè¿æ»å®ããã¯ãããWeb Share API Level 2ã®ä»æ§ã§ãã
Level 2ã§ã¯ããã¹ãã ãã§ãªããç»åãªã©ãå ±æå¯èœã«ãªã£ãŠããŸãããããïŒ
ã¢ãã€ã«ã§ã¯äžéã察å¿ããŠããããã«èŠããŸãããããŒãžã§ã³ã«ãã£ãŠã¯éšåçã ãšæããŸãã
以äžã®ç°å¢ã§ã¯åäœã確èªããŸããã
- Android10
- Chrome v86
- iPadOS
- v14以äž
- Safariã®å®éšçæ©èœã§
Web Share API Level 2
ãæå¹
Safari14ãããã©ã«ãã§ã¯äœ¿çšã§ããªãã£ããããäžè¬åãã«å®è£ ããã®ã¯æææ©ã ãããããŸããã
èªãã ããš/èŽããããš
åççãªéžæã®æ«ã«ããã€ã®éã«ãäžã®äžã«åãæ®ãããæèŠ
ãšãŠãåãªã..ããããã®äžãªãççãèšãåœãŠãŠãããªãšæããèšäºã§ããã
幎ããšããšåŠã¶æ欲ãèœã¡ãã®ã¯ãè³ãå£åããããã§ã¯ãªã..ã
æéã«å¯Ÿããèãæ¹ãå€ãããæéãæè³ããæããå¢ããã®ã ãšã
ãã£ããã¢ããããªããªã£ãã®ã¯ãèªåã®èå³ãé¢å¿ã®æ¹åãå®ãŸã£ãŠãããããªããããªãããšããæ°ãããŠãããæéãªæéã®äœ¿ãæ¹ã»æ¯ãåãæ¹ãã³ã³ãããŒã«ããããšããæèŠããã匷ããªã£ãŠãããïŒãšãããããæéã¯æéã ããšããæèŠãã幎霢ãéãããšåŒ·ããªã£ãŠãããšããããïŒæã¯èªåã«åããã©ãããé¢çœããã©ããã¯ç¥ãããã©ãšã«ãããã£ãŠã¿ãããããããèããããšããæ 床ã ã£ããã§ãä»ã¯ã»ãšãã©ç¡æèã«ãèªåã«ãšã£ãŠå¿ èŠãªããšãã©ãããæéãè²»ããåªå é äœãã©ãããèããŠåæšéžæããŠããæ°ããããããã¯ä»äºãå§ããŠäœæã®æéãæžã£ããããããããªãããæ¢ã«åãçµãã§ããããšã«ãã£ãšã¡ãããšæ³šåããããšæã£ãŠãããããããããªãã奜å¥å¿ã®ç·éèªäœã¯å€ãããªããŠãããã®æ¹åãå¹ ãåºãŸã£ãŠããŠããããã®ããšèªäœã¯å šç¶æªãããšãããªããŠãããã ãã®å¯äœçšãšããŠåãæ®ãããã
æè¿ãå°ãã§ãæ°ãæããšããã«ãªããŸãã
æ°ããããšãå§ããªãæ匷ã®èšãèš³ãšããŠ..ã
ããšã誰ãããè©äŸ¡ãããªãã£ããšããŠããå¹ ãçããªãããçããŠããããã§ããã
Why I’m switching from Vim to IntelliJ
VimããIntelliJ IDEAã«ã¡ã€ã³éçºç°å¢ãã·ãããã話ã§ãã
ç§ãçŸåšã¯IntelliJ IDEAãã¡ã€ã³ã«ããŠããããã®èšäºã«ã¯ã»ãŒå®å
šåæã§ããã
Vimã¯åäœã軜ããã®ã®ãåçš®éçºãããããã«ã¯éŠ¬é¹¿ã«ãªããªãæºåã®ã³ã¹ããå¿
èŠã§ãã
ãããããããã®ç°å¢æŽåã«ãã£ãŠVimãéããªã..å®ã¯IntelliJ IDEAã䜿ã£ãæ¹ãããã©ãŒãã³ã¹é¢ã§ãåªããŠãã.. ãªããšããæ¬æ«è»¢åãªäºæ
ã«ãæ£ã
ééããŠããŸããã
Vimã®äœéšã¯éåžžã«åºæ¿çã§ãããããŒã éçºã§ããã°ãªãã®ããšã§ãã
äžæ¹ã§Vimã®ããŒãã€ã³ããææ³ã¯IntelliJ IDEAã§ã倧ãã«æŽ»çšã§ããŸãã
å
æ¥ããã®ãããªèœãšãæã暡玢ããèšäºãæžããŸããã®ã§ãããããã°ã
What’s the deal with SvelteKit?
SvelteKitã®ç®æããšããã«ã€ããŠèª¬æãããŠããå ¬åŒã®èšäºã§ãã
ããã³ããšã³ãã®äžçããŸããã©ãã€ã ã·ããã®ææãè¿ãããã®å
ã§ã¯bundleããªãServerlessãäž»äœãšãªã£ãäžçãããã§ããã..ã
Svelteã¯ãããèŠæ®ããŠSvelteKitãéçºãããã®å®æããã£ãŠversion1.0ãšããã..
ãšãã趣æšã®å
容ã§ããã
ããã¥ã¡ã³ãããµããŒãããªããéçºäžã®ãã®ã§ãããã°ãããããšã¯ã§ããã¿ããã§ãã
npm init svelte@next
Svelteã¯4ã¶æåã«å°ã觊ã£ãŠã¿ãŠ..ãã®æã¯ãã¯ãVueã ãªãšæã£ãŠããŸããã
ãã ããã©ãã€ã ã·ããã®å ãŸã§èŠæ®ããŠã®æŠç¥ãšãªãã°è©±ã¯å€ãããŸããã
å人çã«ã¯æ°å¹ŽåŸããããæ°å¹Žåã®Reactãšåãç¶æ
ã«ãªãã®ã§ã¯ãšæã£ãŠããŸãã
bundleå°çãç°å¢æ§ç¯ããæãåºããäžçãèŠãŠã¿ããã§ããð
è©Šããããš
ãTypeScriptãhtml2canvas
HTMLã解æããŠçµæãcanvasã«æç»ãããããã§ãªã©ã€ãã©ãªã
ã¹ã¿ãŒæ°ã¯20000è¶
ããšå€§äººæ°ã§ãã
Vuetifyã®Calendarã³ã³ããŒãã³ãã§ã¹ã¯ããŒã«ãããéšåãäžçºã¹ã¯ãªãŒã³ã·ã§ããæ®ããªãããª..ãšæã£ãŠè©ŠããŸããã
䜿ãæ¹ã¯ãšãŠãç°¡åã§ããã
ç¹å®ã¯ã©ã¹ã®DOMãcanvasã«å€æããããã«ãã€ããªã«ããŠæäœããã³ãŒãã§ãã
import html2canvas from "html2canvas";
const canvas = await html2canvas(
document.querySelector<HTMLElement>(".v-calendar-daily__pane")!,
{
backgroundColor: "#1E1E1E",
}
);
canvas.toBlob(async (blob: Blob | null) => {
// blobãæçãã
}
ãªããCross OriginããååŸããŠããç»åãã¡ã€ã«ãªã©ã¯è¡šç€ºãããŸããã
Optionã«allowTrait: true
ãæå®ãããšè¡šç€ºãããŸããããããããštoBlob
ãtoDataUrl
ã䜿ããªããªããŸãã
ãµãŒããµã€ãã§CORS察çãããã°ããã®ã§ããããªããªãé¢åã§ããã..ã
ä»ã«è§£æ±ºçããªããããªã®ã§ãCross Originã®ç»åã¯äžæŠè«Šããããšã«ããŸããð¢
調ã¹ãããš
ãªã
æŽåããããš
ãGoogle ChromeãBookmark Sidebar
ãµã€ããã¥ãŒã«ç¹åããGoogle Chromeã®ããã¯ããŒã¯ç®¡çæ¡åŒµã§ãã
ååããã·ã³ãã«ã§ããç§ã¯æåããŸããð
æ©èœã¯å¿è«ã®ããš..ãã¥ãŒããªã¢ã«ããã¶ã€ã³ãã³ã³ãã³ãã®å
容ãªã©UXãçŽ æŽãããã§ãã
ä»ãŸã§äœ¿ã£ãæ¡åŒµã®äžã§1çªãšèšã£ãŠãéèšã§ã¯ãªããããã
èŠãç®ããªã·ã£ã¬ã§ããã¢ãã¡ãŒã·ã§ã³ãå¿å°ããã§ããð
æ€çŽ¢ããœãŒãé ãèšå®ã§ããŸãã
èšå®ç»é¢ãæ Œå¥œè¯ããŠæ°ãå©ããŠããŸã..!!
ãã°ãã䜿ã£ãŠã¿ãŠãææŸããªããªã£ããå¯ä»ããããšæã£ãŠãŸãã
ãããããæåããŸããð
ãVimãCamelCaseMotionã®å°å ¥
CamelCaseãlower_caseãªã©ã§åèªããšã«ç§»åã§ããã¢ãŒã·ã§ã³ãå°å
¥ããŸããã
VimãJetBrains IDEãVS Codeã®ããããã§äœ¿ããŸãã
]
ãã§éå§ããããã«ããŠããŸãã
Vimã®å Žå
Vundleå©çšæã
Plugin 'bkad/CamelCaseMotion'
let g:camelcasemotion_key = ']'
JetBrains IDEã®å Žå
ããã©ã«ãã§]
ã«å²ãåœãŠãããŠããŸãã
VS Codeã®å Žå
èšå®ã§ONã«ããŸãã
"vim.camelCaseMotion.enable": true,
ããŒãã€ã³ããã
{
"before": ["]"],
"after": ["<leader>"]
},
ãVimãFernã®å°å ¥
NerdTreeã®ãããªãã¡ã€ã©ãŒã§ãã
ãã©ã°ã€ã³åœ¢åŒãæ¡çšããŠãããå¿
èŠãªæ©èœã®ã¿ãå°å
¥ããææ³ã§ãã
éåæã«åŠçãè¡ããããããå¥ã®åäœã劚ããããšã¯ãªãã®ããã€ã³ãã
ãã æç»ã«é¢ããŠã¯å¥ãªã®ã§ãjkæŒãã£ã±ãªãæã®æç»é床ã¯èœã¡ãŸãã
.vimrc
ã®èšå®ã¯ãããªæãã§ãã
Plugin 'lambdalisue/fern.vim'
nnoremap <C-j>w :Fern %:h -drawer -width=50<cr>
Plugin 'lambdalisue/nerdfont.vim'
Plugin 'lambdalisue/glyph-palette.vim'
augroup my-glyph-palette
autocmd! *
autocmd FileType fern call glyph_palette#apply()
autocmd FileType nerdtree,startify call glyph_palette#apply()
augroup END
Plugin 'lambdalisue/fern-renderer-nerdfont.vim'
let g:fern#renderer = "nerdfont"
Plugin 'lambdalisue/fern-git-status.vim'
å®çŸããŠããä»å æ©èœã¯ä»¥äžã
<C-j>w
ã§ã«ã¬ã³ããããã¡ã«å¯ŸããããªãŒã衚瀺- Nerdfontã«ããã«ã©ãŒã¢ã€ã³ã³è¡šç€º
- Gitã¹ããŒã¿ã¹ã®è¡šç€º
ãªããWindowsã ãšGitã¹ããŒã¿ã¹ã¯è¡šç€ºãããŸããããVimã«ãããŸã§æ±ããŠããªãã®ã§å人çã«ã¯åé¡ãªãã§ãã
芪ãã£ã¬ã¯ããªã«ç§»åãããšã€ãªã¢ã¹ã®èšå®
æ®æ®µãã䜿ããã®ç§»åã³ãã³ãã
cd ..
å
¥åæ°ã¯å°ãªãã§ãããããªãç©ãããšéŠ¬é¹¿ã«ãªããŸããããã
ãã¡ãããšã€ãªã¢ã¹ã«ç»é²ããŸããã
PowerShell
function ..() { cd ../ }
function ...() { cd ../../ }
function ....() { cd ../../../ }
Bash
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
ãGitãGit LFS管çãããã
æ¬ããã°ãšMimizou Roomã®Git LFS管çããããŸããã
çç±ã¯ä»¥äžãäžèšã§èšããšLFSã®ãŠãŒã¹ã±ãŒã¹ã«é©ããªãã£ãã ãã§ãã
- 10Mãè¶
ãããããªå€§ããªãã¡ã€ã«ã¯ãªã
- å¿ èŠãªãå€éšåç §ã«ãã
- GitHubã®LFS Storage容éã䜿ããããªã
- 1GBå¶éãããã®ã§æ°ãé£ã
- äžåºŠã³ããããããªãœãŒã¹ãå€æŽããæ©äŒã¯ã»ãŒãªã
- Netlifyãªã©ã§ãããã€ãããšãLFSèµ·å ã§å€±æããããšããã°ãã°ãã
察象ãªããžããªã«ã€ããŠã¯ä»¥äžã®æµããå®æœããŸããã
git lfs uninstall
rm .gitattributes
git lfs ls-files
# begin
git rm --cached **/*.png
# end ãããæ¡åŒµååç¹°ãè¿ã
git add --all
git commit -m "Git LFSãããã"
git push
# äžåºŠLocalããã¬ã€ã«ãã(.git/lfsåé€ãäž»ãªç®ç)
rm -rf ãªããžããª
# cloneããªãã
git clone ãªããžããª
ä»é±ã®ãªãªãŒã¹
Togowl v2.15.0
Dailyã«ã¬ã³ããŒã®Shareæ©èœ
Calendarã®Daily衚瀺æã®ã¿ãå ±æãã¿ã³ãã衚瀺æ¥ã®ã«ã¬ã³ããŒç»åãå ±æã§ããŸãã
以äžã®ç°å¢ã«ãããåäœã確èªããŠããŸãã
- Android10
- Chrome v86
- iPadOS
- v14以äž
- Safariã®å®éšçæ©èœã§
Web Share API Level 2
ãæå¹
ãŸãã以äžã®ç°å¢ã§åäœããªãããšã確èªæžã¿ã§ãã
- PC/iPadOSã®Chrome
å
±æããã«ã¬ã³ããŒç»åã¯pngã§ãã
ãããžã§ã¯ãã¢ã€ã³ã³ã¯è¡šç€ºãããŸããã1æ¥ã®äºå®ãå
šãŠå
¥ããŸãã
ãã匷åŒãªå®è£ ãããŠãããããã©ããã®ããŒãžã§ã³ã§é察å¿ã«ãªãå¯èœæ§ããããŸãðââïž
å ±æã§ããç»åã€ã¡ãŒãžã§ãã
瞊ã«é·ãã§ããw
ãã®ä»
Quizletã®åèªæ°
æ¬æ¥æç¹ã§ã®åèªæ°ã¯83(+15)ã§ãã