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 / .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 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 / 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 backup.py
@task
def backup():
""" Backup Backup Backup """
if not _has_tag('backup'):
abort("Hum… What are you doing? Dude, this server is not allowed to backup!")
@jacquesbh
jacquesbh / bouh-magento.php
Created Jun 7, 2015
[blog] dette technique
View bouh-magento.php
<?php
if (SOMETHING_TRUE) {
return true;
} else {
return false;
}
@jacquesbh
jacquesbh / colors.php
Created Jun 25, 2012
Hexa colors in PHP loop
View colors.php
<?php
define('PAD', 1);
define('WIDTH', 1);
define('HEIGHT', 1);
ob_start();
echo '<table cellspacing="0" cellpadding="0" border="0" style="margin: 0; padding: 0;">';
@jacquesbh
jacquesbh / php-config.txt
Created Jul 3, 2012
My PHP configure command line for Max OS X (works for Magento)
View php-config.txt
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli=mysqlnd --with-mysqli=shared,mysqlnd --with-curl --with-mcrypt --with-gd --with-libxml-dir=/usr --with-openssl=/usr --enable-exif --with-freetype-dir=/usr/X11R6 --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --enable-gd-native-ttf --with-icu-dir=/usr --with-iodbc=/usr --with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --with-tidy --enable-pdo --with-pdo-mysql --with-config-file-path=/conf --with-pear --with-zlib=/usr --with-bz2=/usr --with-kerberos --enable-soap --enable-ftp --enable-zip
@jacquesbh
jacquesbh / .vimrc
Last active Oct 6, 2015
Simple .vimrc for servers
View .vimrc
set nocompatible
set encoding=utf-8
filetype on
filetype plugin on
filetype indent on
syntax enable
set background=dark
set number
set laststatus=2
set cmdheight=1
View patchMagentos.sh
#!/bin/bash
# CREATE BACKUPS BEFORE RUNNING THIS SCRIPT!
# RUN THIS SCRIPT IN THE MAIN DIR OF YOUR APPLICATION (where the app/ is located)
for m in $(find app/ -iname Mage.php); 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
@jacquesbh
jacquesbh / restore.sh
Created Jul 9, 2012
Restore a local database with .sql.gz file
View restore.sh
# Restore a database
function restore()
{
if [[ $# < 2 ]]; then
echo "Usage: restore <database> <file.sql[.tar].gz> [-gz]"
echo "Use -gz option if you want to restore an only gziped file"
return 65
fi
if [[ -f $2 ]]; then