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
public function findClient(Query $query, array $options) | |
{ | |
$query->matching( | |
'OfferTypes', function ($q) use ($options) { | |
return $q->where(['OfferTypes.id' => $options['client']['offer_type_id']]); | |
} | |
); | |
$query->matching('Clients', function ($q) use ($options) { | |
return $q->where(['Clients.name' => $options['client']['name']]); | |
}); |
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 | |
namespace Admin\Test\TestCase\View\Cell; | |
use Admin\View\Cell\MenuCell; | |
use Cake\TestSuite\TestCase; | |
/** | |
* Admin\View\Cell\MenuCell Test Case | |
*/ | |
class MenuCellTest extends TestCase |
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
public function edit($id) | |
{ | |
$this->Crud->on('beforeFind', function(\Cake\Event\Event $event) { | |
$event->getSubject()->query->contain(['Roles']); | |
}); | |
$this->Crud->execute(); | |
} |
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
/** | |
* Method: edit | |
* | |
* Amend user entity before save | |
* | |
* {@inheritDoc} | |
*/ | |
public function edit($id) | |
{ | |
if ($this->request->is('put')) { |
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
SELECT `ShopProduct`.`id`, `ShopProduct`.`shop_category_id`, `ShopProduct`.`name`, `ShopProduct`.`slug`, `ShopProduct`.`meta_title`, `ShopProduct`.`meta_description`, `ShopProduct`.`meta_keywords`, `ShopProduct`. `heading`, `ShopProduct`.`overview`, `ShopProduct`.`excerpt`, `ShopProduct`.`content`, `ShopProduct`.`sorting`, `ShopProduct`.`upload`, `ShopProduct`.`status`, `ShopProduct`.`created`, `ShopProduct`.`created_by`, `ShopProduct`.`modified`, `ShopProduct`.`modified_by`, `ShopProduct`.`shop_order_item_count`, (`I18n__name`.`content`) AS `ShopProduct__i18n_name`, (`I18n__slug`.`content`) AS `ShopProduct__i18n_slug`, (`I18n__meta_title`.`content`) AS `ShopProduct__i18n_meta_title`, (`I18n__meta_description`.`content`) AS `ShopProduct__i18n_meta_description`, (`I18n__meta_keywords`.`content`) AS `ShopProduct__i18n_meta_keywords`, (`I18n__overview`.`content`) AS `ShopProduct__i18n_overview`, (`I18n__heading`.`content`) AS `ShopProduct__i18n_heading`, (`I18n__excerpt`.`content`) AS |
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
$query->leftJoinWith('TicketExecutors'); | |
$query->where(['TicketExecutors.id' => $options['request']['restrictByUserId']]); | |
$query->leftJoinWith('TicketOwners'); | |
$query->orWhere(['TicketOwners.id' => $options['request']['restrictByUserId']]); |
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
$(window).resize(function() { | |
$.each($('.blog-posts'), function(key, value) { | |
var height = 0; | |
$.each($('.item', value), function(key2, value2) { | |
if ($(value2).height() > height) { | |
height = $(value2).height(); | |
} | |
}); | |
console.log(height); | |
$.each($('.item', value), function(key2, value2) { |
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
# backup all rsync projects, weekly | |
0 11 * * 5 nice -n 19 livedrive-backup golfmore >> /home/lubos/.livedrive 2>&1 | |
# Daily backups (weekdays) | |
10 10 * * 1,2,3,4,5 nice -n 19 rsync-16x "-azv --exclude-from=/home/lubos/0rsync/.exclude" vmrates:httpdocs/01/ /home/lubos/0rsync/vmrates/ vmrates >> /home/lubos/0rsync/.log/vmrates`date +\%Y-\%m-\%d`.log 2>&1 | |
# Weekly backups | |
10 10 * * 1 nice -n 19 rsync-3x "-azv --exclude-from=/home/lubos/0rsync/schillings/.exclude" schillings:httpdocs/ /home/lubos/0rsync/schillings/ schillings >> /home/lubos/0rsync/.log/schillings`date +\%Y-\%m-\%d`.log 2>&1 | |
10 10 * * 3 nice -n 19 rsync-3x "-azv --exclude-from=/home/lubos/0rsync/.exclude" gcha:httpdocs/01/ /home/lubos/0rsync/gcha/ gcha >> /home/lubos/0rsync/.log/gcha`date +\%Y-\%m-\%d`.log 2>&1 | |
10 10 * * 5 nice -n 19 rsync-3x "-azv --exclude-from=/home/lubos/0rsync/.exclude" fitzroviapartnership:httpdocs/02/ /home/lubos/0rsync/fitzrovia/ fitzrovia >> /home/lubos/0rsync/.log/fitzrovia`date +\%Y-\%m-\%d`.log 2>&1 |
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
LESS_SOURCE = ./app/webroot/frontpage/css/less/style.less | |
CSS_TARGET = ./app/webroot/frontpage/css/style.min.css | |
BOOTSTRAP_SOURCE = ./app/webroot/frontpage/js/bootstrap/ | |
JS_TARGET = ./app/webroot/frontpage/js/app.min.js | |
build: | |
@recess --compress --compile ${LESS_SOURCE} > ${CSS_TARGET} | |
@cat \ | |
./app/webroot/app/js/jquery/jquery-1.10.2.min.js \ | |
./app/webroot/app/js/jquery/jquery.cookie.js \ |
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
You can use split for this: | |
tar czpvf - /path/to/archive | split -d -b 100M - tardisk | |
This tells tar to send the data to stdout, and split to pick it from stdin - additionally using a numeric prefix (`-d`), a chunk size (`-b`) of 100M and using 'disk' as the base for the resulting filenames (tardisk00, tardisk01, etc.). | |
To extract the data afterwards you can use this: | |
cat tardisk* | tar xzpvf - |
NewerOlder