Skip to content

Instantly share code, notes, and snippets.

% be irb -ractive_support/all
irb(main):001:0> options = { a: 1, b: 2, c: 3 }
=> {:a=>1, :b=>2, :c=>3}
irb(main):002:0> options.merge c: 4, d: 5
=> {:a=>1, :b=>2, :c=>4, :d=>5}
irb(main):003:0> options.reverse_merge c: 4, d: 5
=> {:c=>3, :d=>5, :a=>1, :b=>2}
irb(main):004:0>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b8be4a..4df9452 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@ ENDIF()
CHECK_FUNCTION_EXISTS(powl HAVE_POWL)
IF(NOT HAVE_POWL)
- ADD_DEFINITIONS("-Dpowl=pow")
+# ADD_DEFINITIONS("-Dpowl=pow")
package MySQLCasualLog;
use strict;
use warnings;
use utf8;
use DBIx::QueryLog;
use Term::ANSIColor;
use Text::ANSITable;
*** HTTP requests total: 202764 ***
*** HTTP requests stats order by time ***
count: 18433, total: 188.261999999996, mean: 0.0102133130798023
path: /login
count: 3483, total: 8.70599999999991, mean: 0.00249956933677861
path: /mypage
@kamipo
kamipo / server_id
Created February 11, 2015 04:07
MySQLとか(Tokyo|Kyoto)ナントカのserver_idを計算するために使ってたコマンド
#!/usr/bin/perl -l
use strict;
use warnings;
$ENV{LANG} = "C";
$ENV{PATH} ||= "/usr/local/bin:/usr/bin/:/bin";
my $eth = shift || "eth0";
`ip addr list dev $eth|grep 'inet '` =~ m{\.(\d+?)\.(\d+?)\/};
@kamipo
kamipo / eth2ip
Created February 11, 2015 04:19
configファイルとかの中のIPで置換したいところに使う用のIP返すだけのコマンド
#!/usr/bin/perl -l
use strict;
use warnings;
$ENV{LANG} = "C";
$ENV{PATH} ||= "/usr/local/bin:/usr/bin/:/bin";
my $eth = shift || "eth0";
`ip addr list dev $eth|grep 'inet '` =~ m{inet (\d+?\.\d+?\.\d+?\.\d+?)\/};
escape 
defkanji utf-8
defencoding utf-8
encoding utf-8 utf-8
startup_message off
autodetach on
vbell off
defscrollback 5000
set nocompatible
syntax on
filetype plugin indent on
" encoding
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,euc-jp,sjis,iso-2022-jp,cp932
{
use Catalyst::Utils ();
no warnings 'redefine';
sub Catalyst::Utils::class2prefix {
my $class = shift || '';
my $case = shift || 0;
my $prefix;
if ( $class =~ /^.+?::([MVC]|Model|View|Controller)::(.+)$/ ) {
$prefix = $case ? $2 : do {
$prefix = $2;
{
use CSS::Tiny::Style ();
no warnings 'redefine';
sub CSS::Tiny::Style::_sel_arr {
local $_ = shift;
my @d;
while ($_) {
my ($tag, $op);