Skip to content

Instantly share code, notes, and snippets.

takeshy takeshy

Block or report user

Report or block takeshy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View log2bin.rb
#!/usr/bin/ruby
if ARGV.length != 1
puts "#{$0} outputfile"
exit -1
end
unless file = File.open(ARGV[0],"wb")
puts "#{$0} outputfile"
puts "#{ARGV[0]} can't write"
exit -1
@takeshy
takeshy / vscofnig.json
Created Jun 23, 2019
settings json for vs code
View vscofnig.json
{
"editor.minimap.enabled": false,
"editor.formatOnSave": true,
"tslint.alwaysShowRuleFailuresAsWarnings": true,
"window.zoomLevel": 2,
"explorer.confirmDelete": false,
"files.trimTrailingWhitespace": true,
"files.eol": "\n",
"typescript.updateImportsOnFileMove.enabled": "always"
}
@takeshy
takeshy / .vimrc
Created Nov 15, 2018
remove trailing space on save
View .vimrc
function! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre *.ts,*.rb,*.tsx,*.js,*.erb :call <SID>StripTrailingWhitespaces()
View eijiro_to_dicwin.rb
#!/usr/bin/env ruby
require 'nkf'
raw = File.read("#{ENV['HOME']}/Downloads/EIJIRO-1445.TXT")
data = NKF.nkf("-w -d", raw)
results = {}
first_flg = false
data.each_line do |raw_line|
next if !first_flg && !raw_line.match(/a\s+{不-1}/)
View table_info.rb
#!/usr/bin/ruby
require 'rubygems'
require 'mysql'
require 'optparse'
options = {
:database => '',
:host=> 'localhost',
:create=> false,
:count=> false,
:index=> false,
@takeshy
takeshy / read_ts.vim
Last active Jul 11, 2018
typescriptのimport先のファイルの読み込み
View read_ts.vim
function! ReadFile() abort
let s:currentPos = col('.')
let s:colNum = s:currentPos - 1
let s:lastPos = len(getline('.'))
let s:fileName = ''
let s:ext = '.' . expand("%:e")
while s:colNum > -1
if getline('.')[s:colNum] =~ "\['\"\]"
break
end
View confirm_git_branch_D.rb
#!/usr/bin/env ruby
branches = `git branch`
branches.each_line do|line|
branch = line.gsub(/\s/,"")
next if branch[0] == "*"
puts "################"
puts "#{branch}\n"
puts "################"
puts `git branch -d #{branch}`
@takeshy
takeshy / readfile.vim
Last active Sep 3, 2016
javascriptでimport先のファイルやejsファイルをsplitで開く
View readfile.vim
function! ReadJSFile() abort
let s:currentPos = col('.')
let s:colNum = s:currentPos - 1
let s:lastPos = len(getline('.'))
let s:fileName = ''
while s:colNum > -1
if getline('.')[s:colNum] =~ "\['\"\]"
break
end
View vimrc
execute pathogen#infect()
syntax on
ab conlog <script>console.log("<%= %>")</script>
ab vimed sp ~/.vimrc<CR>
nmap ! :execute ":lcd " . expand("%:p:h")<CR>
map <C-f> :let @* = expand("%:p")<CR>
let g:skk_auto_save_jisyo=1
let g:skk_large_jisyo='~/.vim/SKK-JISYO.L'
set ts=2
set sw=2
@takeshy
takeshy / hex2bin.rb
Created Apr 22, 2015
HEX文字列をbinaryに変換する
View hex2bin.rb
#!/bin/env ruby
$HEX = false
if ARGV[0] == "-x"
$HEX = true
ARGV.shift
end
if ARGV.length != 1
puts "#{$0} outputfile"
exit -1
You can’t perform that action at this time.