Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jacques Bodin-Hullin jacquesbh

🏠
Working from home
View GitHub Profile
@jacquesbh
jacquesbh / README.md
Last active Aug 29, 2015
Install mocodo in a vagrant box
View README.md

Install mocodo in your vagrant

In your vagrant, user vagrant:

curl -fsSL https://gist.githubusercontent.com/jacquesbh/11047250/raw/mocodo_install.sh | bash
View login.js
/*
* 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 Aug 29, 2015
My tmux configurations
View .tmux.conf.master
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
View bad.php
<?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 Sep 18, 2013
Surprise with "customer/account/loginPost/" at the end of your magento's URL
View gist:6616584
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 Feb 18, 2021
/etc/init.d/firewall Iptables firewall
View 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.
View guest_mount.sh
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 Mar 16, 2013
Install MariaDB on debian squeeze
View add_keys.sh
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
@jacquesbh
jacquesbh / Helper.php
Last active Dec 14, 2015
[Blog] Bien afficher un attribut personnalisé http://jacques.sh/2013/02/afficher-un-attribut.html
View Helper.php
<?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 Feb 1, 2013
Change hints in Magento quickly ;)
View hints.php
<?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);