Skip to content

Instantly share code, notes, and snippets.

/**
* Returns an array of products IDs for products matching the search query
*
* @param string $query
* @return array
*/
public function search($query)
{
if (is_numeric($query)) {
$return = $this->_client->search(
#GIT_WORK_TREE=/var/www/us git checkout -f
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
# branch=`echo $1 | cut -d/ -f3`
GIT_WORK_TREE=/var/www/us git checkout -f $branch
done
unset $(git rev-parse --local-env-vars)
@rsmarshall
rsmarshall / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
150415 23:57:22 [ERROR] Plugin 'InnoDB' init function returned error.
150415 23:57:22 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150415 23:57:22 [ERROR] Unknown/unsupported storage engine: InnoDB
150415 23:57:22 [ERROR] Aborting
150415 23:57:22 [Note] /usr/sbin/mysqld: Shutdown complete
Apr 15 23:56:18 srv-ebun7 kernel: [2288365.548656] init: mysql main process ended, respawning
Apr 15 23:56:19 srv-ebun7 kernel: [2288366.507794] init: mysql post-start process (20143) terminated with status 1
Apr 15 23:56:19 srv-ebun7 kernel: [2288366.523131] type=1400 audit(1429138579.066:52): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=20176 comm="apparmor_parser"
Apr 15 23:56:19 srv-ebun7 kernel: [2288366.604836] init: mysql main process (20188) terminated with status 1
Apr 15 23:56:19 srv-ebun7 kernel: [2288366.604856] init: mysql respawning too fast, stopped
Apr 15 23:57:13 srv-ebun7 kernel: [2288420.895836] type=1400 audit(1429138633.438:53): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=20273 comm="apparmor_parser"
Apr 15 23:57:13 srv-ebun7 kernel: [2288420.936812] type=1400 audit(1429138633.482:54): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/tcpdump" pid=20275 com
* Reloading AppArmor profiles Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 45: syntax error, unexpected TOK_CLOSE, expecting TOK_MODE
Apr 15 23:37:25 srv-ebun7 dhclient: DHCPACK of 10.225.20.22 from 10.225.20.21
Apr 15 23:37:25 srv-ebun7 dhclient: bound to 10.225.20.22 -- renewal in 1632 seconds.
Apr 15 23:39:01 srv-ebun7 CRON[18078]: (root) CMD ( [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
Apr 15 23:40:01 srv-ebun7 CRON[18104]: (smmsp) CMD (test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp)
Apr 15 23:45:55 srv-ebun7 kernel: [2287742.714429] type=1400 audit(1429137955.258:39): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/var/log/mysqld.log" pid=18576 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=106 ouid=106
Apr 15 23:46:25 srv-ebun7 /etc/init.d/mysql[18932]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Apr 15 23:46:25 srv-ebun7 /etc/init.d/mysql[18932]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Apr 15 23:46:25 srv-ebun7 /etc/init.d/mysql[18932]: error: 'Can't connect to local MySQL server t
pr 15 23:29:30 srv-ebun7 kernel: [2286758.293788] init: mysql main process (17018) terminated with status 1
Apr 15 23:29:30 srv-ebun7 kernel: [2286758.293812] init: mysql main process ended, respawning
Apr 15 23:29:31 srv-ebun7 kernel: [2286759.256565] init: mysql post-start process (17019) terminated with status 1
Apr 15 23:29:31 srv-ebun7 kernel: [2286759.270236] type=1400 audit(1429136971.814:36): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=17052 comm="apparmor_parser"
Apr 15 23:29:31 srv-ebun7 kernel: [2286759.352085] init: mysql main process (17064) terminated with status 1
Apr 15 23:29:31 srv-ebun7 kernel: [2286759.352100] init: mysql main process ended, respawning
Apr 15 23:29:32 srv-ebun7 kernel: [2286760.318726] init: mysql post-start process (17065) terminated with status 1
Apr 15 23:29:32 srv-ebun7 kernel: [2286760.333006] type=1400 audit(1429136972.878:37): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld"
--skip-syslog
--log-error=/var/log/mysqld.log
--pid-file=/var/run/mysqld/mysqld.pid
/**
* Add multiple items (used for opticon app upload)
*
* @param array $data
* @return array $feedback
*/
public function addMultipleItems($data)
{
$branchId = $this->_customer->getBranchId();
$trolleyId = $this->_trolleyRepository->findIdByCustomerId($this->_customer->getId());