This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use Imager; | |
my $file = shift or die "Usage: $0 image"; | |
my $img = Imager->new(file => $file) or die Imager->errstr; | |
my ($width, $height) = ($img->getwidth, $img->getheight); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; move point to 'use section or package' | |
(defvar cperl/mib-orig-marker (make-marker)) | |
(defun cperl/move-import-block () | |
(interactive) | |
(progn | |
(set-marker cperl/mib-orig-marker (point-marker)) | |
(if (re-search-backward "^\\(use\\|package\\)\[ \n\]+\[^;\]+;" nil t) | |
(progn | |
(goto-char (match-end 0)) | |
(next-line)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
package Lispl; | |
use Scalar::Util qw(blessed looks_like_number); | |
use List::Util qw(reduce); | |
my $global_env; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; inspired and based on anything-vim-hacks | |
;; | |
(defconst perldoc-jp:buffer-name "*perldoc-jp*") | |
(defconst perldoc-jp-core:url "http://perldoc.jp/index/core") | |
(put 'perldoc-jp:exception-not-retrieved 'error-message "Perldoc jp - Not retrieved") | |
(put 'perldoc-jp:exception-not-retrieved 'error-conditions | |
'(perldoc-jp:exception-not-retrieved error)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; document | |
(defmacro major-mode-eql (mode) | |
`(eql major-mode ,mode)) | |
(defun my/man () | |
(interactive) | |
(let* ((manual-program | |
(cond | |
((or (major-mode-eql 'cperl-mode) (major-mode-eql 'perl-mode)) "perldoc") | |
((or (major-mode-eql 'python-mode) (major-mode-eql 'py-mode)) "pydoc") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; spliting window when opening woman buffer | |
(defadvice woman-really-find-file (around woman-split-window activate) | |
(switch-to-buffer-other-window (get-buffer-create "*woman-dummy*")) | |
ad-do-it) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/t/01-connect.t b/t/01-connect.t | |
index cf6b335..d0b79fc 100644 | |
--- a/t/01-connect.t | |
+++ b/t/01-connect.t | |
@@ -2,6 +2,7 @@ use strict; | |
use Test::More tests => 8; | |
use Net::SSL; | |
+use Errno (); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(progn | |
(setq sleep-process (start-process "test" nil "sleep" "60")) | |
(run-at-time 5 nil (lambda () | |
(when (eq (process-status sleep-process) 'run) | |
(kill-process sleep-process) | |
(message "kill process sleep"))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; goto-column | |
(defun my/goto-column (column) | |
(interactive | |
(list (read-string "Goto Column: "))) | |
(move-to-column (string-to-int column))) | |
(global-set-key (kbd "M-g c") 'my/goto-column) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; move current directory | |
(defadvice shell-pop-up (around shell-pop-up-around activate) | |
(let ((cwd (nth 1 (split-string (pwd))))) | |
ad-do-it | |
(insert cwd) | |
(eshell-send-input) | |
(recenter-top-bottom 0))) |