Skip to content

Instantly share code, notes, and snippets.

@millionfor
millionfor / tree.sh
Last active October 10, 2022 03:32
A script to generate the directory structure
#!/bin/bash
# vim: set ft=sh fdm=manual ts=2 sw=2 sts=2 tw=85 et:
# =======================================================
# Description: A script to generate the directory structure
# Author QuanQuan <millionfor@apache.org>
# Last Modified Mon, Oct 10, 2022 11:32
# GistID 19ddb2633bb715852a31eeae03f88a6a
# GistURL https://gist.github.com/millionfor/19ddb2633bb715852a31eeae03f88a6a
# =======================================================
@millionfor
millionfor / get-iconfont-data.js
Last active August 9, 2022 06:56
A script to download iconfont font library based on js
/**
* @fileName getIconfontData
* @dateTime 2021/11/18 15:30:25 <Thursday>
* @author QuanQuan <millionfor@apache.org>
* @gistId c144eef4c9da1e1ea73135b95e429361
* @description Get Iconfont data
*/
const fs = require('fs');
const path = require('path');
@millionfor
millionfor / hss-upload-oss.sh
Last active August 9, 2022 06:40
A shell-based oss upload script
#!/bin/bash
# vim: set ft=sh fdm=manual ts=2 sw=2 sts=2 tw=85 et:
# =======================================================
# Description:
# Author QuanQuan <millionfor@apache.org>
# Last Modified Tue, Aug 09, 2022 14:40
# GistID 3ef404655274805b6ff6068bc90e3540
# GistURL https://gist.github.com/millionfor/3ef404655274805b6ff6068bc90e3540
# =======================================================
#!/bin/bash
# vim: set ft=sh fdm=manual ts=2 sw=2 sts=2 tw=85 et:
# =======================================================
# Description: Get the real path in the bin directory
# Author QuanQuan <millionfor@apache.org>
# Created Time Tue, Jun 21, 2022 11:36
# Last Modified Tue, Jun 21, 2022 11:36
# GistID 6a5b6d4f853afa607378fbec08e326b6
# GistURL https://gist.github.com/millionfor/6a5b6d4f853afa607378fbec08e326b6
##############################################################################
# VIM CHEATSHEET (中文速查表) - by skywind (created on 2017/10/12)
# Version: 47, Last Modified: 2020/10/10 11:02
# https://github.com/skywind3000/awesome-cheatsheets
##############################################################################
##############################################################################
# 光标移动
##############################################################################
def CamelToSneak(name: string): string
var l = []
var start = true
for ch in split(name, '\zs')
if ch =~# '\u'
l->add('_')
endif
l->add(tolower(ch))
endfor
function minjs#Done(file)
echo s:min_file . " written!"
endfunction
function minjs#Minify()
let s:min_file = expand('%:r') . '.min.' . expand('%:e')
silent! %s/\/\/.*//g
silent! %s/\n//g
silent! %s/\r//g
{
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
"brace_style": "collapse",
"end_with_newline": true,
"indent_char": " ",
"indent_handlebars": true,
"indent_inner_html": false,
"indent_scripts": "keep",
"indent_size": 2,
" 持久化撤销
set undofile
set undodir=~/.config/nvim/cache/undodir
" 折叠
set foldenable
set foldmethod=manual
set viewdir=~/.config/nvim/cache/viewdir
au BufWritePost * mkview
autocmd BufNewFile *.vue,*.js,*.ts,*.sh,*.css call SetTitle()
autocmd BufWritePre *.vue,*.js,*.ts,*.sh,*.css call SetLastModified()
let s:getCreatedTimeStr = {->printf(' * @CreatedTime %s', strftime("%a, %b %d, %Y %R"))}
let s:getModifiedTimeStr = {->printf(' * @LastModified %s', strftime("%a, %b %d, %Y %R"))}
func s:getTemplete(type)
let templates = {
\'vue': [
\ "<template>",