Skip to content

Instantly share code, notes, and snippets.

View jacquesbh's full-sized avatar
🏠
Working from home

Jacques Bodin-Hullin jacquesbh

🏠
Working from home
View GitHub Profile
@jacquesbh
jacquesbh / README.md
Last active August 29, 2015 14:00
Install mocodo in a vagrant box
/*
* Dans un test j'ai ça : var ret = this.login(customer_email, customer_password);
* Dans un pre.js j'ai la méthode suivante :
*/
casper.login = function(username, password) {
this.thenOpen(url_customer_account_login, function() {
utils.dump('foo');
@jacquesbh
jacquesbh / .tmux.conf.master
Last active August 29, 2015 13:56
My tmux configurations
set-option -g default-command "reattach-to-user-namespace -l zsh"
source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
#set-window-option -g automatic-rename off
## Screen like binding
unbind C-b
set -g prefix C-x
## Bigger history
set -g history-limit 10000
<?php
// Get the old store
$oldStore = Mage::app()->getStore(true);
// Set the new store
/* @var $customer Mage_Customer_Model_Customer */
$newStore = Mage::app()->getStore($customer->getStoreId());
Mage::app()->setCurrentStore($newStore);
// Here my code... Am I really on the new store?
@jacquesbh
jacquesbh / gist:6616584
Created September 18, 2013 22:23
Surprise with "customer/account/loginPost/" at the end of your magento's URL
Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/magento/app/code/core/Mage/Captcha/Model/Observer.php on line 69
#0 [internal function]: mageCoreErrorHandler(2, 'array_key_exist...', '/var/www/magent...', 69, Array)
#1 /var/www/magento/app/code/core/Mage/Captcha/Model/Observer.php(69): array_key_exists('username', NULL)
#2 /var/www/magento/app/code/core/Mage/Core/Model/App.php(1338): Mage_Captcha_Model_Observer->checkUserLogin(Object(Varien_Event_Observer))
#3 /var/www/magento/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Captcha_Model_Observer), 'checkUserLogin', Object(Varien_Event_Observer))
#4 /var/www/magento/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#5 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(532): Mage::dispatchEvent('controller_acti...', Array)
#6 /var/www/magento/app/code/core/Mage/Core/Controller/Front/Action.php(64): Mage_Core_Controller_Var
@jacquesbh
jacquesbh / firewall
Last active February 18, 2021 17:14
/etc/init.d/firewall Iptables firewall
#!/bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall
# Description: Configure all iptables rules.
@jacquesbh
jacquesbh / guest_mount.sh
Created August 2, 2013 17:12
vagrant nfs errors
vagrant@vagrant-debian-wheezy:~$ sudo mount -v -o vers=3 192.168.42.1:'/Users/jacques/Sites/laurecrea/htdocs/' /var/www/magento/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Fri Aug 2 13:11:26 2013
mount.nfs: trying text-based options 'vers=3,addr=192.168.42.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.42.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.42.1 prog 100005 vers 3 prot UDP port 44373
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.42.1:/Users/jacques/Sites/laurecrea/htdocs/
@jacquesbh
jacquesbh / add_keys.sh
Created March 16, 2013 12:51
Install MariaDB on debian squeeze
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
@jacquesbh
jacquesbh / Helper.php
Last active December 14, 2015 05:09
[Blog] Bien afficher un attribut personnalisé http://jacques.sh/2013/02/afficher-un-attribut.html
<?php
class Jbh_ProductAttribute_Helper_Output extends Mage_Core_Helper_Abstract
{
/**
* Change the output of our attribute
* @param Mage_Catalog_Helper_Output $outputHelper The helper
* @param string $attributeHtml The HTML
* @param array $params The parameters
@jacquesbh
jacquesbh / hints.php
Created February 1, 2013 14:26
Change hints in Magento quickly ;)
<?php
defined('__DIR__') || define('__DIR__', dirname(__FILE__));
// Inclure Mage
require_once __DIR__ . '/../app/Mage.php';
// Init Mage
Mage::app('admin')->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);