This file contains 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
#!/bin/bash | |
set -e | |
# specify your MFA_DEVICE_ARN | |
MFA_DEVICE_ARN=YOUR_MFA_ARN | |
if [ MFA_DEVICE_ARN=YOUR_MFA_ARN ]; then | |
echo "Please specify the MFA_DEVICE_ARN" | |
exit 1 | |
fi |
This file contains 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 | |
$list = $this->Transacciones->find() | |
->distinct(...) | |
->select(...) | |
->contain(...) | |
->order(...) | |
->reject(...) | |
->sortBy(...); |
This file contains 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 | |
use Cake\Database\Log\QueryLogger; | |
use Cake\ORM\Query; | |
class myLog extends QueryLogger | |
{ | |
public function toStatement(Query $query) | |
{ | |
$sql = $query->sql(); |
This file contains 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
$registros = $source_table->find()->order('id'); | |
$inicio = time(); | |
$diff = time(); | |
foreach ($registros as $registro) { | |
//for ($n = 0; $n < 500000; $n++) { //<-------------- see the difference when iterating over a for(0..500k) than over a foreach($registros) | |
$num++; | |
if ($num % 100 == 0) { | |
$memoria_usada = number_format(memory_get_usage(true), 0); | |
$to_log = __("used memory: ".$memoria_usada."\t$num records processed (time ".(time() - $inicio)."; diff: ".(time() - $diff).")"); |
This file contains 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 | |
/** | |
* @package Joomla.Platform | |
* @subpackage Database | |
* | |
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
defined('JPATH_PLATFORM') or die; |