Skip to content

Instantly share code, notes, and snippets.

View tsuyoshicho's full-sized avatar

Tsuyoshi CHO tsuyoshicho

View GitHub Profile
@tsuyoshicho
tsuyoshicho / APImemo.txt
Last active May 17, 2019 01:54
vim vital ID API memo
API
ID.UUID
build ({uuid byte-list})
return uuid struct
decode({uuid hex-string})
let s:Base32 = g:V.import('Data.Base32')
let s:List = g:V.import('Data.List')
let s:Random = g:V.import('Random')
let s:bitwise = g:V.import('Bitwise')
function! s:ulid() abort
let timelist = s:List.new(6, 0)
let randomlist = s:List.new(10, 0)
let timestamp = localtime()
@tsuyoshicho
tsuyoshicho / uuiddecode.vim
Created May 14, 2019 08:06
uuid decode vim test
" UUID
" 0 1 2 3
" 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
" +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
" | time_low |
" +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
" | time_mid | time_hi_and_version |
" +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
" |clk_seq_hi_res | clk_seq_low | node (0-1) |
" +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@tsuyoshicho
tsuyoshicho / base36test.vim
Created May 14, 2019 08:06
Base36 test vim
" base36
" byte list
function! s:base36encode(data)
let data = a:data
let base36code = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let base36codelist = split(base36code, '.\zs')
let retval = ''
for i in data
@tsuyoshicho
tsuyoshicho / file1.js
Last active May 28, 2019 06:26 — forked from khsk/file1.js
はてなのシロクマを屑籠に放り込むユーザースクリプト ref: http://qiita.com/khsk/items/0cb47046d1721099c729
B.RegistReminder = {
count: function () {
if (B.user) {
B.cookie.clear('vcount');
} else {
var vcount = B.cookie.get('vcount');
vcount = vcount ? ++vcount : 1;
B.cookie.set('vcount', vcount , '+10y');
if (vcount % 40 == 0) {
@tsuyoshicho
tsuyoshicho / test.md
Created April 2, 2019 06:23
文章記法テスト

H1タイトル

本文

# よくあるコメント

@tsuyoshicho
tsuyoshicho / test.md
Created January 8, 2019 04:11
shell highlight test

shell test

" comment1
$ user test1
# root test1
-> output1

shell-session test

@tsuyoshicho
tsuyoshicho / .vimrc
Created December 20, 2018 08:01
vimのsyntaxのデバッグの補助コマンド ref: https://qiita.com/tsuyoshi_cho/items/6497874940a2f2351a31
" function
function! s:EchoSyntax(status)
if a:status
redraw | echon synIDattr(synID(line('.'), col('.'), 0), 'name')
endif
endfunction
" command
command! SyntaxEcho :call <SID>EchoSyntax(1)
@tsuyoshicho
tsuyoshicho / file0.txt
Last active December 20, 2018 07:17
vimでgithub emojiをUnicode emojiにする ref: https://qiita.com/tsuyoshi_cho/items/89bd707b536ed202efbe
[[plugins]] # completion <C-X><C-U> (user completion)
repo = 'junegunn/vim-emoji'
@tsuyoshicho
tsuyoshicho / plantuml_in_md.vim
Created October 23, 2018 04:33
context_filetype setting for PlantUML in Markdown (known as Boostnote)
let g:context_filetype#filetypes = {
\ 'markdown': [
\ {
\ 'start' : '\_.\%(@startuml\)\@=',
\ 'end' : '\%(@enduml\)\@<=\_.', 'filetype' : 'plantuml',
\ },
\ ],
\}