Skip to content

Instantly share code, notes, and snippets.

View tsuyoshicho's full-sized avatar

Tsuyoshi CHO tsuyoshicho

View GitHub Profile
@ncw
ncw / README.md
Created July 21, 2020 20:45
Response to File System Interfaces for Go proposal

This is going to be a long reply based in my experiences with rclone: https://rclone.org. Rclone interfaces with 30ish different cloud providers and has some very similar interfaces so I feel like I might have something to contribute!

As part of rclone I have made very similar interfaces. In fact there are two, one lower level more matched to the typical things cloud storage systems can do (eg read as streams, use Range requests, not seek in writes) and one which is more general purpose which can do everything a normal file system can (eg seek while writing, ReadAt,

@xl1
xl1 / gist:940d653451fd96a06618a6df08d5df84
Last active July 21, 2025 10:14
PDF に謎の漢字が含まれるとき

PDF に謎の漢字が含まれるとき

PDF などの中にある一部の日本語の漢字が、見た目は同じだけど異なる謎の文字に変換されていることがある

@Milly
Milly / vopen.cmd
Last active April 13, 2020 08:11
Open file with existence vim instance.
@echo off
setlocal
set target=%~1
if "" == "%target%" set target=.
if not "" == "%VIM_TERMINAL%" (
echo | set /p=]51;["drop","%target:\=\\%"]
) else if not "" == "%VIM_SERVERNAME%" (
gvim --servername %VIM_SERVERNAME% --remote-silent "%target%"
set runtimepath^=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
call dein#begin('~/.cache/dein', [$MYVIMRC, '~/.vim/rc/test.toml'])
call dein#load_toml('~/.vim/rc/test.toml', {'lazy': 0})
call dein#end()
call dein#save_state()
endif
" install vim-pulg
if has('vim_starting')
set rtp+=~/.vim/plugged/vim-plug
if !isdirectory(expand('~/.vim/plugged/vim-plug'))
echo 'install vim-plug...'
call mkdir(expand('~/.vim/plugged/vim-plug'), 'p')
call system('git clone https://github.com/junegunn/vim-plug.git ' . expand('~/.vim/plugged/vim-plug/autoload'))
end
endif
" setup
@itchyny
itchyny / go114-regression.md
Last active April 8, 2020 23:23
Go 1.14の主なregression

Go 1.14 の主なregressionです。1.14.1で修正されると思われます。

@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active October 12, 2025 01:36
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

@koron
koron / wrap-limit-v
Last active January 18, 2020 14:42
apply cgroup memory limitation as `ulimit -v` virtual memory limitation
#!/bin/sh
set -eu
cgroup_rsslimit="/sys/fs/cgroup/memory/memory.limit_in_bytes"
if [ -r "$cgroup_rsslimit" ] ; then
rsslimit=`cat "$cgroup_rsslimit"`
vszlimit=`expr $rsslimit / 1024`
ulimit -v $vszlimit
@pocke
pocke / this-year-repos.rb
Last active December 31, 2019 06:30
Print repositories created this year
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'octokit'
end
name = ARGV[0] || `git config --get github.user`.chomp
year = ARGV[1] || Time.now.year
function! s:fuzzy(lhs, rhs) abort
return a:lhs =~ join(map(split(a:rhs, '\zs'), "printf('[\\x%02x].*', char2nr(v:val))"), '')
endfunction
let g:asyncomplete_preprocessor =
\ [function('asyncomplete#preprocessor#ezfilter#filter')]
let g:asyncomplete#preprocessor#ezfilter#config = {}
let g:asyncomplete#preprocessor#ezfilter#config['*'] =
\ {ctx, items -> filter(items, 's:fuzzy(v:val.word, ctx.base) != 0')}