Skip to content

Instantly share code, notes, and snippets.

View violetyk's full-sized avatar

kagaya violetyk

View GitHub Profile
@violetyk
violetyk / setting.md
Created January 6, 2016 15:36
ref.vimででPHPのマニュアルをひいていたときの設定

vimrcへの設定

if neobundle#is_sourced('vim-ref') " {{{
  if has('win32') || has('win64')
    let g:ref_phpmanual_path = $VIM . '/vimfiles/manual/php_manual_ja/'
  else
    let g:ref_phpmanual_path = $HOME . '/.vim/manual/php_manual_ja/'
  endif
@violetyk
violetyk / export-url-from-about.rb
Created December 2, 2015 02:16
CSVからURLを抽出してCSVファイルに書き出すスクリプト
# "12345", "long text...."
# "12346", "long text...."
require 'csv'
require 'uri'
CSV.open('url.csv', 'wb', force_quotes: true) do |output|
CSV.read('about.csv', encoding: 'UTF-8:UTF-8', header_converters: nil).map do |input|
tmp = []
tmp << input[0]
tmp << URI.extract(input[1])
@violetyk
violetyk / geta.rb
Created September 9, 2015 05:29
機種依存文字やASCII制御文字を下駄文字(12307)に変更する
def to_geta(str)
ng_codepoints = [
*0x00..0x09,
*0x0b..0x0c,
*0x0e..0x1f,
0x7f,
*0x2150..0x219F,
*0x2460..0x24EF,
*0x2600..0x2660,
*0x3220..0x324F,
@violetyk
violetyk / test.sh
Created August 14, 2015 10:21
docker run をコンテナの並列実行
#!/bin/bash
DIRS=("/bin" "/etc" "/usr") # SUCCESS
# DIRS=("/bin" "/etc" "/usr" "/hogehoge") # FAILURE
IDS=""
for D in ${DIRS[*]}; do
IDS=$IDS" `docker run -d ubuntu du -sh $D`"
done
setlocal autoindent
setlocal formatoptions=tcroqln
setlocal nofoldenable
setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,b:-,b:+,b:*
abbreviate td [ ]
abbreviate tl - [ ]
nnoremap <silent><buffer> <Leader><Leader> :call ToggleCheckbox()<CR>
vnoremap <silent><buffer> <Leader><Leader> :call ToggleCheckbox()<CR>
@violetyk
violetyk / gist-file0.md
Last active August 29, 2015 14:20
cakephp3 tutorial

php, composer, mysqlのインストール

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php56 composer mysql

composerの補完

@violetyk
violetyk / gist:429b885d467d7a5b40d2
Last active August 29, 2015 14:15
md5とsha1とmapのソート
h := md5.New()
io.WriteString(h, "The fog is getting thicker!")
pp.Println(hex.EncodeToString((h.Sum(nil))))
h2 := sha1.New()
io.WriteString(h2, "The fog is getting thicker!")
pp.Println(hex.EncodeToString((h2.Sum(nil))))
s := "http://localhost:8080/xx/yy/zz/hogehoge.png:e?hoge=fuga&k=v#f"
pp.Println(url.QueryEscape(s))
@violetyk
violetyk / .vimrc
Created January 31, 2015 08:04
PDV--phpDocumentor-for-Vimの設定
NeoBundle 'vim-scripts/PDV--phpDocumentor-for-Vim'
if neobundle#is_sourced('PDV--phpDocumentor-for-Vim') " {{{
inoremap <Leader>d <ESC>:call PhpDocSingle()<CR>i
nnoremap <Leader>d :call PhpDocSingle()<CR>
vnoremap <Leader>d :call PhpDocRange()<CR>
endif " }}}
@violetyk
violetyk / .vimrc
Created January 31, 2015 08:03
breeze.vimの設定
" NeoBundle 'gcmt/breeze.vim'
if neobundle#is_sourced('breeze.vim') " {{{
let g:breeze_highlight_filename_patterns = '*.ctp,*.html,*.htm,*.xhtml,*.xml'
let g:breeze_highlight_tag = 1
let g:breeze_hl_color = 'ctermbg=LightGrey ctermfg=Black guibg=LightGrey guifg=Black '
" nnoremap th :<C-u>BreezeHlElementBlock<CR>
endif " }}}
@violetyk
violetyk / .vimrc
Created January 31, 2015 07:46
easymotionの設定
NeoBundleLazy 'Lokaltog/vim-easymotion'
if neobundle#is_sourced('vim-easymotion') " {{{
" ホームポジションに近いキーを使う
let g:EasyMotion_keys = 'hjklasdfgyuiopqwertnmzxcvbHJKLASDFGYUIOPQWERTNMZXCVB'
let g:EasyMotion_leader_key = "<Space>"
" 1 ストローク選択を優先する
let g:EasyMotion_grouping = 1
" カラー設定変更
hi EasyMotionTarget ctermbg=none ctermfg=red