Skip to content

Instantly share code, notes, and snippets.

@syohex
syohex / _paco.zsh
Created October 8, 2012 03:40
Completion paco in zsh
#compdef paco
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for paco
#
# Source: http://paco.sourceforge.net/
#
# ------------------------------------------------------------------------------
@syohex
syohex / osaka_subway.pl
Created October 14, 2012 07:42
Osaka Subway with Graph::Gviz
#!perl
use strict;
use warnings;
use Graph::Gviz;
use Math::Normalize::Range;
use Text::CSV_XS;
use Math::Round qw/nearest/;
use utf8;
@syohex
syohex / japan.pl
Created October 15, 2012 13:57
Sample of Graph::Gviz
#!/usr/bin/env perl
use strict;
use warnings;
use lib qw(../lib);
use utf8;
use Text::CSV_XS;
use Graph::Gviz;
@syohex
syohex / dstat_color.diff
Created October 18, 2012 14:07
fix dstat color
--- dstat 2012-10-18 23:05:42.783979537 +0900
+++ /usr/bin/dstat 2012-10-18 23:02:31.767976670 +0900
@@ -1633,9 +1633,9 @@
'debug': ansi['darkred'],
'input': ansi['darkgray'],
'text_lo': ansi['gray'],
- 'text_hi': ansi['darkgray'],
- 'unit_lo': ansi['darkgray'],
- 'unit_hi': ansi['darkgray'],
+ 'text_hi': ansi['gray'],
@syohex
syohex / realtime_markdown_viewer.rb
Created October 21, 2012 04:06
Realtime markdown viewer by Sinatra
#!/usr/bin/env ruby
# -*- coding:utf-8 -*-
require 'sinatra'
require 'sinatra-websocket'
require 'redcarpet'
set :server, 'thin'
set :sockets, []
@syohex
syohex / json_xs_atof.patch
Created October 24, 2012 07:01
Use Perl atof instead of JSON::XS
diff --git a/XS.xs b/XS.xs
index c140314..3c96065 100644
--- a/XS.xs
+++ b/XS.xs
@@ -1227,7 +1227,7 @@ decode_num (dec_t *dec)
}
// loss of precision here
- return newSVnv (json_atof (start));
+ return newSVnv (Atof (start));
@syohex
syohex / actress.list
Created October 24, 2012 14:17
actress ranking in DMM
さとう遥希
小早川怜子
ちとせりこ
JULIA
椎名理紗
麻美ゆま
春原未来
一条綺美香
吉沢明歩
椎名ゆな
@syohex
syohex / description_style.patch
Created October 30, 2012 14:16
Description style for emacs-jedi
diff --git a/jedi.el b/jedi.el
index 0e66af4..8fe65e0 100644
--- a/jedi.el
+++ b/jedi.el
@@ -182,6 +182,21 @@ To make this option work, you need to use `jedi:setup' instead of
;;; AC source
+(defcustom jedi:ac-description-style 'long
+ "How to display description"
@syohex
syohex / move_window_smartrep.el
Created November 5, 2012 14:05
move window easily with smartrep
(require 'smartrep)
(setq windmove-wrap-around t)
(windmove-default-keybindings)
(smartrep-define-key
global-map "M-s" '(("h" . 'windmove-left)
("j" . 'windmove-down)
("k" . 'windmove-up)
("l" . 'windmove-right)))
@syohex
syohex / carp_level_sample.pl
Created November 5, 2012 14:29
Sample of Carp::CarpLevel
#!perl
use strict;
use warnings;
package Fuga;
sub bar {
Carp::croak("I'm bar");
}