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
static public function asString(array $a) : string | |
{ | |
return array_reduce(array_keys($a), function($str, $sectionName) use ($a) { | |
$sub = $a[$sectionName]; | |
return $str . "[$sectionName]" . PHP_EOL . | |
array_reduce(array_keys($sub), function($str, $key) use($sub) { | |
return $str . $key . '=' . $sub[$key] . PHP_EOL; | |
}) . PHP_EOL; | |
}); | |
} |
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
function keyed_array_map($fn, array $a) : array | |
{ | |
return array_column(array_map($fn, array_keys($a), $a), 1, 0); | |
} |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: Outputs the date/time | |
Resources: | |
TimeFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
Runtime: nodejs8.10 |