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 5.014; | |
use warnings; | |
my $file = $ARGV[0]; | |
system qw/sips -d profile --deleteColorManagementProperties/, $file; | |
my $dpiWidth = `sips -g dpiWidth $file | awk '/:/ {print \$2}'`; | |
my $dpiHeight = `sips -g dpiHeight $file | awk '/:/ {print \$2}'`; | |
my $pixelWidth = `sips -g pixelWidth $file | awk '/:/ {print \$2}'`; |
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 5.014; | |
use warnings; | |
use utf8; | |
my $ebook_convert = '/Applications/calibre.app/Contents/MacOS/ebook-convert'; | |
my $file = shift; | |
if (!$file || ! -f $file) { | |
die "no files are specified!\n"; |
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 Benchmark qw(cmpthese); | |
use DBI; | |
use Test::More; | |
{ | |
package DBIC::Schema::Result::User; | |
use parent qw/DBIx::Class::Core/; |
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 constant {HOGE => 10}; | |
use Test::More; | |
use Test::Mock::Guard; | |
{ | |
my $g = mock_guard main => { HOGE => sub { 100 }}; | |
is HOGE, 10; |
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
package Hoge; | |
use strict; | |
use warnings; | |
use utf8; | |
use MyCon; | |
sub hage { | |
HOGE; | |
} |
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 5.014; | |
use strict; | |
use warnings; | |
while (my $d = <DATA>) { | |
say ord($_) for split //, $d; | |
say ''; | |
} | |
__DATA__ |
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 5.014; | |
my $str = " | |
abc"; | |
say ord($_) for split //, $str; |
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 ruby | |
require 'fileutils' | |
require 'securerandom' | |
def main | |
user = IO.popen("whoami", "r+").gets.chomp | |
# capture png file | |
tmpfile = "/tmp/image_upload#{$$}.png" |
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
App::Ack :19 | |
YAML :19 | |
Devel::NYTProf :18 | |
Perl::Tidy :18 | |
App::cpanminus :17 | |
Dist::Zilla :17 | |
Moose :17 | |
Test::Pod :16 | |
JSON :15 | |
DBD::SQLite :14 |
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 peco-src () { | |
local selected_dir=$(ghq list --full-path | perl -pe 's/(\Q$ENV{HOME}\E(.*$))/$2\0$1/' | peco --null --query "$LBUFFER") | |
if [ -n "$selected_dir" ]; then | |
BUFFER="cd ${selected_dir}" | |
zle accept-line | |
fi | |
zle clear-screen | |
} |