const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
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
| <?php | |
| public function testSetCookieAction() | |
| { | |
| $value = '12345'; | |
| $html = '<html><body>test set cookie varName =' . $value . '</body></html>'; | |
| $response = new Response($html); | |
| $response->headers->setCookie(new Cookie('varName', $value, time() + (3600 * 48))); | |
| return $response; | |
| } |
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
| --- Source: http://solaimurugan.blogspot.ru/2010/10/list-out-all-forien-key-constraints.html | |
| SELECT | |
| tc.constraint_name, | |
| tc.constraint_type, | |
| tc.table_name, | |
| kcu.column_name, | |
| tc.is_deferrable, | |
| tc.initially_deferred, | |
| rc.match_option AS match_type, |
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
| <?php | |
| // get month name from number | |
| function month_name($month_number){ | |
| return date('F', mktime(0, 0, 0, $month_number, 10)); | |
| } | |
| // get get last date of given month (of year) | |
| function month_end_date($year, $month_number){ |
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
| #!/usr/bin/env python3 | |
| import boto3 | |
| import argparse | |
| import string | |
| parser = argparse.ArgumentParser('Find duplicate objects in an aws s3 bucket') | |
| parser.add_argument('--bucket', dest='myBucket', default='yourBucketName', help='S3 Bucket to search') | |
| cliArgs = parser.parse_args() |
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
| wget \ | |
| --page-requisites \ | |
| --html-extension \ | |
| --convert-links \ | |
| --no-parent \ | |
| --no-check-certificate \ | |
| --recursive \ | |
| https://example.com/ |