Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
sironekotoro / hello.pl
Last active May 22, 2021 16:27
AWS Lambda Sample
#!/usr/bin/env perl
use strict;
use warnings;
sub handler{
return {
string => 'Hello, Perl! from Lambda!!'
}
}
@sironekotoro
sironekotoro / imager_filter_autocrop.pl
Created April 20, 2021 14:38
imager_filter_autocrop.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Imager;
# 変換元と変換先のファイル名を決めておく
my $input_file = 'input.png';
my $output_file = 'output_imager_filter_autocrop.png';
@sironekotoro
sironekotoro / imager_trim.pl
Created April 20, 2021 14:37
imager_trim.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Imager;
# 変換元と変換先のファイル名を決めておく
my $input_file = 'input.png';
my $output_file = 'output_imager_trim.png';
@sironekotoro
sironekotoro / imager_tutrial.pl
Created April 20, 2021 14:34
imager_tutrial.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Imager;
# 変換元と変換先のファイル名を決めておく
my $input_file = 'input.png';
my $output_file = 'output.png';
@sironekotoro
sironekotoro / imager_manually_crop.pl
Created April 20, 2021 14:35
imager_manually_crop.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Imager;
# 変換元と変換先のファイル名を決めておく
my $input_file = 'input.png';
my $output_file = 'output_imager_manually_crop.png';
@sironekotoro
sironekotoro / hello.pl
Created April 2, 2021 10:12
Running Perl with AWS Lambda #3
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
sub handler {
return {
statusCode => 200,
headers => {
'Content-Type' => 'text/plain',
@sironekotoro
sironekotoro / hello.pl
Created March 12, 2021 15:12
Running Perl with AWS Lambda #2
#!/usr/bin/env perl
use strict;
use warnings;
sub handler {
my ($payload, $context) = @_;
# 応答のハッシュに追加してみる
$payload->{hello} = "World!";
@sironekotoro
sironekotoro / hello.pl
Created March 12, 2021 14:56
Running Perl with AWS Lambda
#!/usr/bin/env perl
use strict;
use warnings;
sub handler {
my ($payload, $context) = @_;
return $payload;
}
1;
@sironekotoro
sironekotoro / gist:4f3194d6a983f1840e2f263c5a5c8cc8
Last active October 15, 2020 09:27
Net::Google::Spreadsheets::V4 からGoogle Sheet 更新
#!/usr/bin/env perl
use strict;
use warnings;
# https://twitter.com/sironekotoro/status/1316671830745214978?s=20
use utf8;
use Net::Google::Spreadsheets::V4;
my $CLIENT_ID = "";
// https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html
const holidays = [
"2020/8/10",
"2020/9/21",
"2020/9/22",
"2020/11/3",
"2020/11/23",
"2020/12/29", // 従業員就業規則 第二十条 (4) 年末年始(12月29日〜1月3日)
"2020/12/30", // 同上
"2020/12/31", // 同上