This file contains 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
(defun func1 (func) | |
(funcall func)) | |
(defun func2 (func) | |
(func1 | |
(lambda () | |
(funcall func)))) | |
(func2 | |
(lambda () |
This file contains 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
(defun func1 (func) | |
(funcall func)) | |
(defun func2 (func) | |
(func1 | |
(lambda () | |
(funcall func)))) | |
(func2 | |
(lambda () |
This file contains 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
(require 'cl-lib) | |
(defvar newline-or-open-line/open-line-count 0) | |
(make-variable-buffer-local 'newline-or-open-line/open-line-count) | |
(defun newline-or-open-line/increment-open-line () | |
(setq newline-or-open-line/open-line-count (+ newline-or-open-line/open-line-count 1))) | |
(defun newline-or-open-line/clear-open-line-count () | |
(setq newline-or-open-line/open-line-count 0)) |
This file contains 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
(require 'cl-lib) | |
(defvar newline-or-open-line/open-line-count nil) | |
(make-variable-buffer-local 'newline-or-open-line/open-line-count) | |
(defun newline-or-open-line/increment-open-line () | |
(push 'open-line newline-or-open-line/open-line-count)) | |
(defun newline-or-open-line/clear-open-line-count () | |
(progn |
This file contains 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
(defun newline-or-open-line () | |
"newline-or-openline is a new command for merging C-m and C-o" | |
(interactive) | |
(let ((string-exists-before-cursor (string-match "[^\\\s\\\n\\\t]" (buffer-substring (point-at-bol) (point)))) | |
(string-exists-after-cursor (string-match "[^\\\s\\\n\\\t]" (buffer-substring (point) (point-at-eol))))) | |
(cond ((or (eolp) | |
(not string-exists-after-cursor) | |
(and string-exists-before-cursor string-exists-after-cursor)) | |
(progn (newline) (indent-according-to-mode))) | |
(t (progn (open-line 1) (indent-according-to-mode)))))) |
This file contains 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
(defun newline-or-open-line () | |
"newline-or-openline is a new command for merging C-m and C-o" | |
(interactive) | |
(cond ((or (eolp) | |
(not (string-match "[^\\\s\\\n\\\t]" (buffer-substring (point) (point-at-eol))))) | |
(progn (newline) (indent-according-to-mode))) | |
(t (progn (open-line 1) (indent-according-to-mode))))) | |
(define-key global-map (kbd "C-m") 'newline-or-open-line) |
This file contains 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
(defun newline-or-open-line () | |
"newline-or-openline is a new command for merging C-m and C-o" | |
(interactive) | |
(cond ((or (eolp) | |
(not (string-match "[^\\\s\\\n]" (buffer-substring (point) (point-at-eol))))) | |
(progn (newline) (indent-according-to-mode))) | |
(t (progn (open-line 1) (indent-according-to-mode))))) | |
(define-key global-map (kbd "C-m") 'newline-or-open-line) |
This file contains 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
use strict; | |
use warnings; | |
use Plack::Test; | |
use HTTP::Request; | |
use Benchmark qw/timethis/; | |
my $app = sub { [200, [], ['Hello, World!']] }; | |
test_psgi $app, sub { | |
my $cb = shift; |
This file contains 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
/Users/namai/workspace/prog/perl/bench: | |
total used in directory 0 available 9773356 | |
drwxr-xr-x 2 namai staff 68 9 14 00:36 . | |
drwxr-xr-x 17 namai staff 578 9 14 00:36 .. |
This file contains 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Perl::Metrics::Simple; | |
use constant { | |
EXIT_STATUS_SUCCESS => 0, | |
PERL_MODULE_FILENAME_PATTERN => qr/\.(pm|pl)$/, | |
LIMIT_LINES_OF_CODE => 150, | |
BASE_COMMIT => '9e732c2', |