I hereby claim:
- I am lighty on github.
- I am hikalin8686 (https://keybase.io/hikalin8686) on keybase.
- I have a public key ASBnqZ6ocPYScOOllRU83h7dYnCsAHRmoqnW2wjNEZff7Qo
To claim this, I am signing this object:
//******************************** | |
// 配列のグループ化処理 | |
// | |
// 指定したキーで、配列を以下の例の様にグルーピングする | |
// [ | |
// [ "id"=>1, "valueA"=>"aaa", "valueB"=>"bbb"], | |
// [ "id"=>1, "valueA"=>"ccc", "valueB"=>"ddd"], | |
// ] | |
// | |
// ↓↓↓↓↓↓↓↓ |
foreach(DateTimeZone::listIdentifiers() as $val){ | |
date_default_timezone_set('UTC'); | |
$utcTime = strtotime('2012-01-01 00:00:00'); | |
date_default_timezone_set($val); | |
$date = date("Y/m/d H:i:s", $utcTime); | |
print $val."\t".$date."\n"; | |
} |
$endOfMonth = date('Y-m-t', strtotime($from)); |
$startOfThisMonth = date('Y-m-1', strtotime($from)); | |
$startOfNextMonth = date('Y-m-d', strtotime($startOfThisMonth.' +1 month')) ; | |
$endOfNextMonth = date('Y-m-t', strtotime($startOfNextMonth)); |
//******************************** | |
// 配列のグループ化処理 | |
// | |
// 指定したキーで、配列を以下の例の様にグルーピング | |
// | |
// $a = array( | |
// array("idA"=>1, "idB"=>"aaa", "val"=>"hoge1"), | |
// array("idA"=>1, "idB"=>"aaa", "val"=>"hoge2"), | |
// array("idA"=>1, "idB"=>"iii", "val"=>"fuga1"), | |
// array("idA"=>1, "idB"=>"iii", "val"=>"fuga2"), |
class KeyGrouper{ | |
public static function group($records, $keys){ | |
$groupedRecords = array(); | |
foreach($records as $record){ | |
$primaryKeyString = KeyGrouper::primaryKeyString($record, $keys); | |
$groupedRecords[$primaryKeyString][] = $record; | |
} | |
return $groupedRecords; | |
} | |
I hereby claim:
To claim this, I am signing this object:
# '#/components/schemas/BadRequest' | |
# → components/schemas/BadRequest.yml | |
# '#/components/responses/unauthorized' | |
# → components/responses.yml#/unauthorized | |
require 'yaml' | |
require 'fileutils' | |
require 'pry' |