gitignore.ioを使うのが楽っぽいので、以下のようにする。
curl -L http://gitignore.io/api/windows,visualstudio > .gitignore
core.quotepathをfalseにすれば、文字化けは発生しない。
| // 複数行テキストの余分なインデントを除去する。 | |
| String.prototype.dedent = function() { | |
| const lines = this.split("\n"); | |
| const indent = lines | |
| .map(line => line.match(/^\s+(?=[^\s])/)?.[0].length) | |
| .filter(n => n) | |
| .reduce((a, b) => Math.min(a, b)); | |
| const re = new RegExp(`^\\s{${indent}}`); | |
| return lines | |
| .map(line => line.replace(re, "")) |
| // 指定した条件の位置に値を追加する。合致しない場合は末尾に追加する。 | |
| Array.prototype.insertIf = function(value, condition) { | |
| const index = this.findIndex(condition); | |
| if (index < 0) { | |
| this.push(value); | |
| } else { | |
| this.splice(index, 0, value); | |
| } | |
| return this; | |
| } |
| /** | |
| * 内閣府の祝日リストをインポートします。 | |
| * | |
| * GASに本関数を登録の上、適当なセルに「=importJapaneseHoliday()」と入力すると | |
| * 祝日のリストが出力されます(1955年~翌年まで)。 | |
| * 毎年このデータは更新されるので、メンテナンス無しで祝日がアップデートされます。 | |
| * | |
| * 参照: https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html | |
| * | |
| * IMPORTDATA関数を直接利用する場合に比べて、以下の点で優れています。 |
| function! s:AutoFoldColumn() abort | |
| let l:foldcolumn = auto_origami#Foldcolumn() | |
| if l:foldcolumn > 0 | |
| let l:maxfoldcolumn = s:GetMaxFoldColumn() | |
| if l:foldcolumn < l:maxfoldcolumn | |
| let l:foldcolumn = l:maxfoldcolumn | |
| endif | |
| endif | |
| let &l:foldcolumn = l:foldcolumn | |
| endfunction |
| #! /bin/env bash | |
| # update 18.04 | |
| apt update -y | |
| apt upgrade -y | |
| # reboot | |
| do-release-upgrade | |
| # package install | |
| apt install -y zsh unzip ctags make gcc libssl-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libffi-dev |
| LOCAL_XE = | |
| (DESCRIPTION = | |
| (ADDRESS_LIST = | |
| (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) | |
| ) | |
| (CONNECT_DATA = | |
| (SERVICE_NAME = xe) | |
| ) | |
| ) |
| # uruを使えるようにする | |
| # %URU_HOME%には対応していないので、適宜パスを書き換えてくださいませ。 | |
| # 参考) http://d.hatena.ne.jp/miyamuko/20100905/nyaos_with_pik | |
| uru{ | |
| uru.bat %* | |
| if exist "%USERPROFILE%\.uru\uru_lackee.bat" then | |
| source "%USERPROFILE%\.uru\uru_lackee.bat" 2> nul | |
| endif | |
| } |
| #!/usr/bin/env ruby -Ku | |
| require 'nkf' | |
| class String | |
| def printable! | |
| self.each_char.find_all{|ch| NKF.guess(ch) == NKF::UTF8}.join("") | |
| end | |
| end |