千絮泠泉的博客
千絮泠泉 · 共 360 篇文章
关于UML
关于UML,纠正了很多之前的谬误。 记录个链接: https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-aggregation-vs-composition/
2020-02-28 16:51 · 设计模式 · 评论(0)
mongo打平List的方式
两种方式,一种用$unwind。易出错。麻烦。 推荐用$reduce。 eg(mongo in groovy): [$addfields: [days:[$reduce: [ input: '$days', initialvalue: [], in: [$setunion: ['$$value','$$this']] ]]]],
2019-07-10 11:57 · MongoDB · 评论(0)
FileTypeUtils
package api.xxx.com.upload.utils; import cn.hutool.core.io.FileUtil; /** * * @author Kelvin范显 * @createDate 2019年02月21日 */ final public class FileTypeUtils{ /** * 根据文件名获取文件类型 * @param filename * @return */ public static String getContentTypeByFilename(String filename) { return getContentTypeByExtNa…
2019-02-21 12:21 · javautil · 评论(0)
9.visual_mode
" three sub mode v active char visual V/shift+v active line visual Ctrl+v active chunk visual " visual operator gv reselect last hlselect o swich selection boundary ------------------ vi{ select content in { . repeate last oprator vit select content in tag U/u Upper/lower r replace selection. then …
2019-02-01 03:35 · vim · 评论(0)
8.textObject_macro
" text Object {operator}{a}{object} {operator}{i}{object} daw = delete a word ==a==n object: include tail space ciw = change inner word ==i==nner object: just content self exclude tail word space " word/sentence/paragraph textObject specification w word s sentence p paragraph " chunk object ]/block…
2019-02-01 02:37 · vim · 评论(0)
7.multiWindow_tabGroup
" split screen vim -O/on open horizen/vertical split n:number ctrl+w c/q close this/last window ctrl+w s horizen split this file :sp filename horizen split, and open a new file ctrl+w v vertical split this opened file :vsp filename vertical split, and open a new file ---------- lrm -rf buf-*~ delet…
2019-02-01 01:06 · vim · 评论(0)
6.buffer_multifile_edit
" buffer list :files :buffers :ls touch buf-1 buf-2 buf-3 buf-4 vim buf-* :files :buffers :ls ------------------- 1 %a "buff-1" line 1 2 "buff-2" line 0 3 "buff-3" line 0 4 "buff-4" line 0 bufferno status filename cursorPosition " status a active buffer, load and display h hide buffer, load not dis…
2019-01-31 21:26 · vim · 评论(0)
5.convert_find_substitute
" Insert Shift-i/A insert mode and move to head/tail a/i cursor after/befor insert [n]O/o line before/afer insert n times [n]-i insert mode repeate n times " Convert ~ char upper/lower g ~ w word upper/lower g ~ $/g ~ ~ line upper/lower gU/uw word upper/lower " Find F/f{char} backwards/forewards fi…
2019-01-30 16:18 · vim · 评论(0)
4.reg_delete_copy_paste
Windows Vim Different cut delete as cut, rather than just delete copy yank equal window's copy, but c used to change, yank instead paste put equal head word """""""""""""""""""""""""""""""""""""""""""""""""""" " Register type express example feature -------------------------------------------------…
2019-01-30 15:15 · vim · 评论(0)
3.move_jump_indent
" Move to rowhead 0/^ to end $ w/W next word head b/B previous word head e/E next word tail ge previous word tail " Jump Ctrl-f/F page down Ctrl-b/B page up Ctrl-d/u down/up half page gg first row num-gg num row G last row {g}-Ctrl-g/G fileinfo/{g}more detail " Indent >> / :> right indent m,n> / :m…
2019-01-30 11:13 · vim · 评论(0)
~/.vimrc
// 折叠效果 set foldmethod=indent set foldnestmax=10 set nofoldenable set foldlevel=2 set encoding=utf-8 set number/nonumber
2019-01-30 08:52 · vim · 评论(0)
Linux 命令行快捷键
摘抄自 https://www.cnblogs.com/aslongas/p/5899586.html 常用 ctrl+左右键:在单词之间跳转 ctrl+a:跳到本行的行首 ctrl+e:跳到页尾 Ctrl+u:删除当前光标前面的文字 (还有剪切功能) ctrl+k:删除当前光标后面的文字(还有剪切功能) Ctrl+L:进行清屏操作 Ctrl+y:粘贴Ctrl+u或ctrl+k剪切的内容 Ctrl+w:删除光标前面的单词的字符 Alt – d :由光标位置开始,往右删除单词。往行尾删 说明 Ctrl – k: 先按住 Ctrl 键,然后再按 k 键; Alt – k: 先按住 Alt 键,然…
2019-01-30 07:19 · shortcut · 评论(0)
对setInterval作简单封装
/** * 调用方式 * let i = new Interval(1000) * i.do(()=>console.log(new Date())) * i.stop() */ export default class Interval { constructor(duration) { this.id = -1 this.duration = duration } do(fn) { if (this.id > 0) { throw Error('just do one thing') } else { this.id = setInterval(fn, this.duration) } …
2019-01-29 17:36 · js · 评论(0)
mixin
// base function fn-width-center(w) position absolute width w margin-left 50% - w * 0.5 // caller invoke(arg, fn) fn(arg) // component c-div-full(imgUrl) background url(imgUrl) no-repeat center background-attachment fixed background-size 100% 100% width 100% min-height 100% position: fixed c-btn-ce…
2019-01-29 11:13 · css · 评论(0)