Navigation Menu

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 / .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
/*
* 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 August 29, 2015 14:00
Install mocodo in a vagrant box
@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 June 7, 2015 09:33
[blog] dette technique
<?php
if (SOMETHING_TRUE) {
return true;
} else {
return false;
}
@jacquesbh
jacquesbh / colors.php
Created June 25, 2012 19:53
Hexa colors in PHP loop
<?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 July 3, 2012 12:17
My PHP configure command line for Max OS X (works for Magento)
./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 October 6, 2015 19:17
Simple .vimrc for servers
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
#!/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 July 9, 2012 08:37
Restore a local database with .sql.gz file
# 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