by shigemk2

当面は技術的なことしか書かない

PHP arrayのfilter関数

PHP arrayのfilter関数

https://www.php.net/manual/ja/function.array-filter.php

https://www.php.net/manual/ja/language.types.callable.php

サンプル。第2引数はコールバック型なので、関数名の文字列だったり、 array(クラスオブジェクト、クラス名文字列) だったりする

<?php
function odd($var)
{
    return($var & 1);
}
function even($var)
{
    return(!($var & 1));
}
$array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
echo "Odd :\n";
print_r(array_filter($array1, "odd"));
echo "Even:\n";
print_r(array_filter($array1, "even"));
?>

cloudformationでS3 CloudFront Route53 ACMで署名付きURLのコンボでハマったところ

  • CloudFrontで使う証明書はバージニア限定
  • CloudFrontの署名付きURLの設定はCloudFormationでは書けない そういう設定がない
  • CloudFrontで署名付きURLを発行するにはルート認証情報アカウントから発行された専用キーペアが必要。たぶんこれは人によっては辞めたい事案だとおもう
  • Route53で使うhostedzoneidは固定。cloudfrontのドメインのhostedzoneだから

docs.aws.amazon.com

aws-cloudformation-templates/S3_Website_With_CloudFront_Distribution.yaml at master · awslabs/aws-cloudformation-templates · GitHub

github.com

aws.amazon.com

ruby-build 20191105

ruby-build 20191105

  • Have rbenv install --list output match ruby-build --definitions
  • Detect --strip level when applying diff -ru a b (non-git) patches
  • Ensure missing curl/wget/aria2c error message is shown on stderr
  • Include header files with mruby
  • Use mktemp to securely initialize the build directory

なんかバージョン追加だけじゃない

Release ruby-build 20191105 · rbenv/ruby-build · GitHub