Skip to content

Instantly share code, notes, and snippets.

Tsutomu Kuroda kuroda

Block or report user

Report or block kuroda

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
@kuroda
kuroda / views.rake
Created Jun 21, 2012
Renames all .rhtml views to .html.erb
View views.rake
namespace 'views' do
desc 'Renames all .rhtml views to .html.erb'
task 'rename' do
Dir.glob('app/views/**/*.rhtml').each do |file|
puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}`
end
end
end
View .zshrc.skel
# Prompts
# 30 31 32 33 34 35 36 37
# BK RE GR YE BL MA CY WH
if [ $UID = "0" ]; then
PROMPT="%{%}%n@%m%#%{%} "
else
PROMPT="%{%}%n@%m%#%{%} "
fi
RPROMPT="%{%}[%~]%{%}"
View .zalias.skel
alias a=alias
a ls="/bin/ls $LS_OPTIONS"
a ll="/bin/ls -l $LS_OPTIONS"
a la="/bin/ls -a $LS_OPTIONS"
a lla="/bin/ls -la $LS_OPTIONS"
a rm='rm -i'
a cp='cp -i'
a mv='mv -i'
a less='less -I'
@kuroda
kuroda / check_replication.rb
Last active Dec 14, 2015
A simple script to check if MySQL replication is working normally.
View check_replication.rb
#!/usr/bin/ruby
password = `cat /root/mysql_root_password`
password.strip!
result = `mysql -u root -p#{password} -E -e "show slave status"`
values = {}
result.split(/\n/).each do |line|
if md = line.match(/:/)
key = md.pre_match.strip.to_sym
View .gitconfig
[user]
name = Tsutomu Kuroda
email = t-kuroda@oiax.jp
[alias]
ci = commit
cia = commit --amend
co = checkout
cop = checkout @{-1}
cp = cherry-pick
mf = merge --ff-only
@kuroda
kuroda / init.coffee
Last active Sep 6, 2018
My keymap.cson for Atom Editor
View init.coffee
add_line_markers = (marker) ->
editor = atom.workspace.getActiveTextEditor()
range = editor.getSelectedBufferRange()
editor.moveToBeginningOfLine()
s = range.start.row
e = range.end.row
if e > s && range.end.column == 0
e = e - 1
editor.moveUp()
editor.transact ->
You can’t perform that action at this time.