Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh -u
################################################################################
#-Get infecter of COVID-19 info in Japan.
#-
# [VERSION] 0.0.3
#
#+[USAGE]
#+ $0 [-hV]
#+ $0 [-ctu][-m 'cond']
#+ $0 [-tu][-f field][-m 'cond'] [field1 field2...]
[[plugins]]
repo = 'Shougo/context_filetype.vim'
[[plugins]]
repo = 'Shougo/deoplete.nvim'
depends = 'context_filetype.vim'
on_event = 'InsertEnter'
hook_add = '''
let g:deoplete#enable_at_startup = 2
let g:deoplete#auto_complete_delay = 0
@hacolab
hacolab / dein.vim
Last active February 14, 2020 14:28
" Path configs
" ----------------------------
let s:config_dir=empty($XDG_CONFIG_HOME) ? expand("$HOME/.config") : expand($XDG_CONFIG_HOME)
let s:cache_dir=empty($XDG_CACHE_HOME) ? expand("$HOME/.cache") : expand($XDG_CACHE_HOME)
let s:dein_dir = s:cache_dir . '/nvim/dein'
let s:plugin_list = s:config_dir . '/nvim/dein.toml'
" Install dein
" ----------------------------
if &runtimepath !~# '/dein.vim'
#!/bin/sh
#+[USAGE] $0
#+[STDOUT]
#+ 0: IME OFF
#+ 1: IME ON
if [ -z "$XMODIFIERS" ]; then
# on CUI
UIM_GET_FILE=$UIM_FEP_GETMODE
if [ -n "$UIM_GET_FILE" ]; then
" Direcotry path
let s:config_dir=empty($XDG_CONFIG_HOME) ? expand('$HOME/.config/nvim') : expand($XDG_CONFIG_HOME)
let s:data_dir=empty($XDG_DATA_HOME) ? expand('$HOME/.local/share/nvim') : expand($XDG_DATA_HOME)
" Plugins
" ----------------------------
augroup PluginInstall
autocmd!
autocmd VimEnter * if dein#check_install() | call dein#install() | endif
augroup END
#!/bin/sh
# $0 [-d Depth] [FilePath]
DEFAULT_DEPTH=2
MAX_DEPTH=5
# Analyze option & params
if [ "$1" = "-d" ]; then
depth=$2
file_path=${3-}
else
#!/bin/sh
# Newline mark of hatena blog
NEWLINE=" "
# Append newline mark to continue line
sed -e 's/$/'"${NEWLINE}"'/' \
-e 's/'"${NEWLINE}${NEWLINE}"'$/'"${NEWLINE}"'/' \
-e "s/^${NEWLINE}$//" \
-e '/^ *[#>|]\{1,\}/s/'"${NEWLINE}"'$//' \
#!/bin/sh
PLANE_TEXT_SEP=">"
strip_tags() {
# <tag1>value1</tag1><tag2>value2</tag2><tag3>value3</tag3>
# value1,value2,value3
sed -e "s/<entry>//" -e "s/<\/entry>//" \
| sed "s#<[^>]*>\([^<]*\)</[^>]*>#\1${PLANE_TEXT_SEP}#g" \
| sed "s/>$//"
}
#!/bin/sh
# Line fiead symbol
LF_CHAR=">"
#[INPUT]
# <entry>
# <tag>value1</tag>
# </entry>
# <entry>
#!/bin/sh
clean_link_tag() {
# <link rel="name" href="URL" /> ==> <name>URL</name>
sed 's#<link rel="\([^"]*\).*href="\([^"]*\)".*#<\1>\2</\1>#'
}
clean_category_tag() {
# <category term="name" /> ==> <category>name</category>
sed 's#<category term="\([^"]*\)".*$#<category>\1</category>#'
}
clean_auhor_tag() {