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
--- Plack/HTTPParser/PP.pm.org 2011-05-26 16:21:15.000000000 +0900 | |
+++ Plack/HTTPParser/PP.pm 2011-07-01 17:23:18.000000000 +0900 | |
@@ -52,7 +52,7 @@ | |
$env->{REQUEST_URI} = $uri; | |
my($path, $query) = ( $uri =~ /^([^?]*)(?:\?(.*))?$/s ); | |
- for ($path, $query) { s/\#.*$// if length } # dumb clients sending URI fragments | |
+ for ($path, $query) { s/\#.*$// if (defined && length) } # dumb clients sending URI fragments | |
$env->{PATH_INFO} = URI::Escape::uri_unescape($path); |
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
" Open junk file | |
" via. http://vim-users.jp/2010/11/hack181/ | |
command! -nargs=0 JunkFile call s:open_junk_file() | |
function! s:open_junk_file() | |
if !exists('g:junk_file_basedir') | |
let g:junk_file_basedir = $HOME . '/.vim_junk' | |
endif | |
let l:junk_file_dir = g:junk_file_basedir . strftime('/%Y/%m') | |
if !isdirectory(l:junk_file_dir) | |
call mkdir(l:junk_file_dir, 'p') |
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
#!/bin/sh | |
# install Hopen from github | |
cpanm https://github.com/hayajo/Hopen/tarball/master | |
# install additional modules from filepath | |
for MODULE in modules/*; do | |
cpanm ${MODULE} | |
done |
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 'gist) | |
(setq gist-fetch-url "https://raw.github.com/gist/%d") |
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 'json) | |
(setq hash (make-hash-table :test 'equal)) | |
(puthash "hoge" "HOGE" hash) | |
(puthash "fuga" "FUGA" hash) | |
(puthash "piyo" "PIYO" hash) | |
(json-encode "hoge") ;string | |
(json-encode ["hoge" "fuga" "piyo"]) ;array | |
(json-encode '("hoge" "fuga" "piyo")) ;list | |
(json-encode hash) ;hash-table |
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
(eval-when-compile (require 'cl)) | |
(require 'json) | |
(defvar gist-github-user nil | |
"GitHub username") | |
(defvar gist-github-password nil | |
"GitHub password") | |
(defvar gist-supported-modes-alist '((action-script-mode . "as") | |
(c-mode . "c") | |
(c++-mode . "cpp") |
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
" set cursorline only current window | |
augroup cch | |
autocmd! cch | |
autocmd WinLeave * set nocursorline | |
autocmd WinEnter,BufRead * set cursorline | |
augroup END |
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
(function(){ | |
/** | |
* String or RegExp | |
* e.g) | |
* * /^https?:\/\/mail\.google\.com\// | |
* * 'http://reader.livedoor.com/reader/' | |
* | |
* The autoignorekey_pages is a string variable which can set on | |
* vimperatorrc as following. | |
* |
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
--- DBIx/Skinny/Schema/Loader.pm.org 2011-08-24 10:33:56.000000000 +0900 | |
+++ DBIx/Skinny/Schema/Loader.pm 2011-08-24 10:42:22.000000000 +0900 | |
@@ -58,7 +58,7 @@ | |
connect_options => $connect_options || {}, | |
}; | |
} | |
- $opts->{dsn} =~ /^dbi:([^:]+):/; | |
+ $opts->{dsn} =~ /^dbi:([^:]+):/i; | |
my $driver = $1 or croak "Could not parse DSN"; | |
croak "$driver is not supported by DBIx::Skinny::Schema::Loader yet" |
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
--- Plack/Middleware/Auth/Form.pm.bak 2011-09-06 10:53:44.000000000 +0900 | |
+++ Plack/Middleware/Auth/Form.pm 2011-09-06 11:09:13.000000000 +0900 | |
@@ -74,6 +74,7 @@ | |
$user_id = $params->get( 'username' ); | |
} | |
if( !$login_error ){ | |
+ $env->{'psgix.session.options'}->{change_id}++; | |
$env->{'psgix.session'}{user_id} = $user_id; | |
$env->{'psgix.session'}{remember} = 1 if $params->get( 'remember' ); | |
my $redir_to = delete $env->{'psgix.session'}{redir_to}; |
OlderNewer