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
#!/bin/sh | |
base_branch=$1 | |
if [ -z $base_branch ] ; then | |
echo 'usage: git-delete-merged-branches-with-remote [base_branch]' >&2 | |
exit 1 | |
fi | |
git show-ref --verify --quiet refs/heads/$base_branch | |
if [ $? -ne 0 ] ; then |
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
package HTTP::Body::JSON; | |
use strict; | |
use warnings; | |
use parent qw(HTTP::Body); | |
use JSON::XS; | |
use HTTP::Body; | |
use Encode qw(encode_utf8); | |
# based on tokuhirom-san's code |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use B; | |
my $str = B::perlstring('hel"lo'); | |
$str = eval "$str"; | |
print $str; # => hel"lo |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $str = 'hel"lo'; | |
$str = eval "$str"; # => !!!失敗する!!! | |
print $str; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Digest::MD5; | |
use feature qw/say/; | |
my $str = 'foobar'; | |
my $ctx = Digest::MD5->new; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Digest::MD5; | |
use feature qw/say/; | |
my $str = 'foobar'; | |
my $ctx = Digest::MD5->new; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
use Digest::MD5; | |
use v5.010; | |
my $str = 'ジムに行き筋肉ムキムキ'; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use PerlIO; | |
use Data::Dumper; | |
open my $fh, '<', 'foobar'; | |
warn Dumper(PerlIO::get_layers($fh, details => 1)); # $fhのencodingは変更されていない |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use PerlIO; | |
use Data::Dumper; | |
open my $fh, '<', 'foobar'; | |
warn Dumper(PerlIO::get_layers($fh, details => 1)); # ファイルハンドルのencodingはこの時点では変更されていない |
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
au InsertLeave,CursorMovedI *.js call s:replaceFunctionKeyword2Kotobuki() | |
au BufWritePre,FileWritePre,FileAppendPre *.js call s:replaceAll('寿', 'function') | |
au BufRead,BufWritePost,FileWritePost,FileAppendPost *.js call s:replaceAll('function', '寿') | |
func! s:replaceFunctionKeyword2Kotobuki() | |
let l:line_num = line(".") | |
let l:line = getline(l:line_num) | |
if (l:line ==# '') | |
let l:line_num -= 1 |