TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
This gist assumes:
- you have a local git repo
- with an online remote repository (github / bitbucket etc)
- and a cloud server (Rackspace cloud / Amazon EC2 etc)
- your (PHP) scripts are served from /var/www/html/
- your webpages are executed by apache
- apache's home directory is /var/www/
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 | |
/** | |
* Copyright Magento 2012 | |
* Example of products list retrieve using Customer account via Magento | |
REST API. OAuth authorization is used | |
*/ | |
$callbackUrl = "http://yourhost/oauth_customer.php"; | |
$temporaryCredentialsRequestUrl = | |
"http://magentohost/oauth/initiate?oauth_callback=" . | |
urlencode($callbackUrl); |
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 | |
# CREATE BACKUPS BEFORE RUNNING THIS SCRIPT! | |
for m in $(locate Mage.php | grep -v downloader); do | |
cd $(dirname $(dirname $m)) || (echo && continue) # old locate db | |
MAGE_VERSION=$(php -d error_reporting=0 -r "require 'app/Mage.php'; Mage::app(); echo Mage::getVersion();") | |
if echo $MAGE_VERSION | egrep -q "^[0-9.]+$"; then | |
if [ $MAGE_VERSION "<" 1.4.0.0 ] || [ $MAGE_VERSION ">" 1.7.0.1 ]; then | |
echo -e "No patch available for version $MAGE_VERSION in $(pwd)\n" |
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 | |
/** | |
* Twig Filter for Symfony 2 - truncate HTML string without stripping tags after reach the minimum length of displayed text | |
* Truncates only first-level tags after reach the minimum, so returned text will be >= minimum | |
* Works well with (only?) utf-8 encoding. | |
* | |
* Installation: | |
* 1. Add this file to your bundle into src/Acme/DemoBundle/Twig/TruncateHtmlExtension.php | |
* 2. Update namespace, if your bundle isn't Acme/DemoBundle | |
* 3. Register it in app/config.yml: |
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 Acme\DemoBundle\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Reference; | |
class DoctrineEntityListenerPass implements CompilerPassInterface | |
{ |
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
SERVER_DIR=/var/www/host/server | |
CONSOLE=$(SERVER_DIR)/app/console | |
update: | |
vagrant ssh -- "cd $(SERVER_DIR) && \ | |
sudo composer selfupdate -n -v && \ | |
composer install -n -v" | |
cache: | |
vagrant ssh -- "$(CONSOLE) doctrine:migrations:migrate -n && \ |
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
# Basic example | |
siege -t60s -c20 -d10 'http://robertomurray.co.uk/' | |
# Basic auth; | |
auth=$(echo -n 'username:password' | openssl base64) | |
siege -t60s -c20 -d10 --header="Authorization:Basic $auth" 'https://staging.a-hostname.co.uk/' |