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
import tornado | |
from tornado import gen | |
from tornado.ioloop import IOLoop | |
from tornado.httpclient import AsyncHTTPClient | |
from tornado.queues import Queue | |
q = Queue(maxsize=0) | |
@gen.coroutine | |
def producer(): |
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
diff --git app/code/core/Mage/Api/Model/Server/Adapter/Soap.php app/code/core/Mage/Api/Model/Server/Adapter/Soap.php | |
index 0f9a3fa..1ac0d57 100644 | |
--- app/code/core/Mage/Api/Model/Server/Adapter/Soap.php | |
+++ app/code/core/Mage/Api/Model/Server/Adapter/Soap.php | |
@@ -233,9 +233,9 @@ class Mage_Api_Model_Server_Adapter_Soap | |
: $urlModel->getUrl('*/*/*'); | |
if ( $withAuth ) { | |
- $phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false); | |
- $phpAuthPw = $this->getController()->getRequest()->getServer('PHP_AUTH_PW', false); |
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
diff --git app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php | |
index c698108..6e256bb 100644 | |
--- app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php | |
+++ app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php | |
@@ -444,7 +444,7 @@ class Mage_Adminhtml_Block_Dashboard_Graph extends Mage_Adminhtml_Block_Dashboar | |
} | |
return self::API_URL . '?' . implode('&', $p); | |
} else { | |
- $gaData = urlencode(base64_encode(serialize($params))); | |
+ $gaData = urlencode(base64_encode(json_encode($params))); |
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
diff --git app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php | |
index 9a1710d..04ba86b 100644 | |
--- app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php | |
+++ app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php | |
@@ -68,6 +68,8 @@ class Mage_Authorizenet_Directpost_PaymentController extends Mage_Core_Controlle | |
public function responseAction() | |
{ | |
$data = $this->getRequest()->getPost(); | |
+ unset($data['redirect_parent']); | |
+ unset($data['redirect']); |
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
import os | |
class DiskInodes(object): | |
def __init__(self, agent_config, checksLogger, rawConfig): | |
self.agent_config = agent_config | |
self.checks_logger = checksLogger | |
self.raw_config = rawConfig |
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
""" | |
Various helper functions to aid in node testing (aka provisioning testing aka unit testing) | |
""" | |
from functools import wraps | |
import hashlib | |
import os | |
from pwd import getpwuid | |
from grp import getgrgid | |
import re |
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
# is there enough space? | |
DBNAME=$(magerun --root-dir=~/public db:info dbname) | |
USAGE_FILE=$(( ( $(du -s --exclude=public/media/\* ~/public | cut -f1) - $(du -s --exclude=public/media/\* ~/staging | cut -f1) ) / 1024 )) | |
USAGE_DB=$(( $(du -s --exclude= /data/mysql/$DBNAME | cut -f1) / 1024 )) | |
FREE_SPACE_PRE=$(( $(stat -f --format='%a*%S/1024' ~/public) / 1024 )) | |
FREE_SPACE_POST=$(( $FREE_SPACE_PRE - $USAGE_FILE - $USAGE_DB )) | |
# Todo: which db tables to exclude? these: magerun db:dump --stdout --only-command --strip="@stripped" | sed -e 's/ /\n/g' | grep ignore-table | cut -d. -f2 |
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 | |
function tt () { | |
curl -kso /dev/null -w "%{time_total}\n" $1 | |
} | |
#alias ttfb='curl -kso /dev/null -w "%{time_starttransfer}\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
processor : 3 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 62 | |
model name : Xen Virtual CPU | |
stepping : 4 | |
microcode : 0x417 | |
cpu MHz : 2593.796 | |
cache size : 20480 KB | |
physical id : 0 |
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
[alias] | |
c = commit -m | |
a = add | |
aa= !git add -u && git add . && git status | |
cb = checkout -b | |
up = !git fetch origin && git rebase origin/master | |
ir = !git rebase -i origin/master | |
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && rake && git push | |
p = pull --rebase --verbose --stat --prune | |
po = !git push -u origin $(git describe --contains --all HEAD) |