Skip to content

Instantly share code, notes, and snippets.

View nanasess's full-sized avatar
🍣
Sushi chef

Kentaro Ohkouchi nanasess

🍣
Sushi chef
View GitHub Profile
@nanasess
nanasess / MysqldumpslowResult2Csv.php
Last active October 12, 2016 01:32 — forked from rysk92/MysqldumpslowResult2Csv.php
mysqldumpslow to csv for MySQL 5.5
<?php
#how to use, mysqldumpslow mysql-slow.log > hoge
# php MysqldumpslowResult2Csv hoge > hoge.csv
$log_filename = $argv[1];
echo 'SQL, Count, Time, Time(total), Lock, Lock(total), Rows_sent, Rows_sent(total), Rows_examined, Rows_examined(totao), Src'."\n";
if (file_exists($log_filename))
{
$contents = file_get_contents($log_filename);
@nanasess
nanasess / .zaliases
Created October 12, 2011 01:33 — forked from kiwanami/.zaliases
Small aliases to get along with Emacs buffer.
## Invoke the ``dired'' of current working directory in Emacs buffer.
function dired () {
emacsclient -e "(dired \"${1:a}\")"
}
## Chdir to the ``default-directory'' of currently opened in Emacs buffer.
function cde () {
EMACS_CWD=`emacsclient -e "
(expand-file-name
(with-current-buffer (e2wm:current-buffer) default-directory))" | sed 's/^"\(.*\)"$/\1/'`