XiaoFeng | 筱枫

Vue.js Concise Memo

Original link: https://hsiaofeng.com/archives/206.html This is a study note for personal use. introduce <script src=”https://unpkg.com/vue@3/dist/vue.global.js”></script> template syntax text interpolation <span>Message: </span> const { createApp } = Vue; let test = createApp ({ data(){ return { msg: “Hello” } } }); test.mount(“#app”); property binding Bind one or more tag properties via Vue. <div v-bind:id=”dynamicId”></div> <!– 简写–> <div …

Vue.js Concise Memo Read More »

Use of C++ HashMap

Original link: https://hsiaofeng.com/archives/204.html #include <iostream> #include <map> typedef unsigned long long ull; using namespace std; map<ull, ull> save; ull F(ull n){ if(save.count(n) != 0) return save[n]; else if(n % 2 == 0) return F(n – 1) + 2; else if(n == 1) return 0; else return F(n – 1) + F(n – 2) – 1; …

Use of C++ HashMap Read More »

Optimize SVG size in Data URLs

Original link: https://hsiaofeng.com/archives/201.html Data URLs , ie URLs prefixed with the data: protocol, allow content creators to embed small files into documents. data:[<mediatype>][;base64],<data> The following steps will keep the Data URLs of the SVG file as short as possible. Use Scour to optimize SVG source code. Here I use Inkscape to save as优化的SVG . Generate …

Optimize SVG size in Data URLs Read More »

Python markdown to HTML via Markdown

Original link: https://hsiaofeng.com/archives/200.html python -m markdown 输入文件.md -f 输出文件.html This article is reproduced from: https://hsiaofeng.com/archives/200.html This site is for inclusion only, and the copyright belongs to the original author.

Python markdown to HTML via Markdown

Original link: https://hsiaofeng.com/archives/200.html python -m markdown 输入文件.md -f 输出文件.html This article is reproduced from: https://hsiaofeng.com/archives/200.html This site is for inclusion only, and the copyright belongs to the original author.

tar Command Notes

Original link: https://hsiaofeng.com/archives/197.html A memo about the tar command. -c 压缩-x 解压-z 有gzip属性的-f 后跟档案名 tar -czf name.tar.gz path/* tar -xzf name.tar.gz This article is reproduced from: https://hsiaofeng.com/archives/197.html This site is for inclusion only, and the copyright belongs to the original author.

Let’s Encrypt Certificate Migration

Original link: https://hsiaofeng.com/archives/195.html Packaging the certificate on the origin server cd /etc/letsencrypt tar zcf letsencrypt.tar.gz archive live renewal Release the certificate on the new server cd /etc/letsencrypt tar zxf letsencrypt.tar.gz This article is reproduced from: https://hsiaofeng.com/archives/195.html This site is for inclusion only, and the copyright belongs to the original author.

Entr detects and modifies auto-execute commands

Original link: https://hsiaofeng.com/archives/192.html screen ls * | entr bash build.sh To leave Screen, press Ctrl+A followed by Ctrl+D . Go back to Screen, use screen -ls screen -r xxx This article is reproduced from: https://hsiaofeng.com/archives/192.html This site is for inclusion only, and the copyright belongs to the original author.

Convert to WebP with FFmpeg

Original link: https://hsiaofeng.com/archives/191.html use case ffmpeg -i “t.jpg” -compression_level 0 -quality 80 -preset photo “[email protected]” Batch: for /f “tokens=1 delims=.” %%a in (‘dir /B *.png’) do ffmpeg -y -i “%%a.png” -compression_level 0 -preset picture “%%a.webp” for /f “tokens=1 delims=.” %%a in (‘dir /B *.jpg’) do ffmpeg -y -i “%%a.jpg” -compression_level 0 -preset picture “%%a.webp” official …

Convert to WebP with FFmpeg Read More »

Easy Python Tutorial

Original link: https://hsiaofeng.com/archives/190.html This is a tutorial for coping with the middle school exam. It aims to quickly learn some basic Python operations and cope with the exam. Take a simple math problem as an example: A bottle of Coke costs 3 yuan, and Xiao Ming bought 2 bottles. How much does he have to …

Easy Python Tutorial Read More »

What exactly is the garbled SSH connection failure?

Original link: https://hsiaofeng.com/archives/186.html connect to the server, prompt ssh: Could not resolve hostname xxx.xyz: \262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243 Preliminary conversion with Python print(“\262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243″) get string ²»ÖªµÀÕâÑùµÄÖ÷»ú¡£ Check the table below, it belongs to “symbol code”, it may be ISO-8859-1 code now. Store it in ISO-8859-1 encoding with VSCode, then open it with GBK, and finally get the string …

What exactly is the garbled SSH connection failure? Read More »