Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / DbFactory.php
Created April 2, 2012 22:12
PrestaShop 1.5.x - Database Factory
<?php
/**
* Database Factory
* Use this factory for connections to external databases
*
* @version 1.0.0
* @author Julien BREUX <julien.breux@prestashop.com>
*/
class DbFactoryCore
{
@JulienBreux
JulienBreux / BlockTags.php
Created April 2, 2012 22:41
PrestaShop 1.5.x - Module override in themes
<?php
/**
* Example of override of Block Tags module
*
* @version 1.0.0
* @author Julien BREUX <julien.breux@prestashop.com>
*/
class BlockTagsTheme extends BlockTags
{
//...
@JulienBreux
JulienBreux / gist:2427844
Created April 20, 2012 11:16
Add website (sudo ./addSite.php <user> <host> <alias>)
#!/usr/bin/php
<?php
define('SUCCESS', "\033[32m".'OK'."\033[37m - ");
define('WARN', "\033[31m".'INFO'."\033[37m - ");
define('EOL', "\n");
## FUNCTIONS
function pecho($string) {fwrite(STDOUT, $string);}
@JulienBreux
JulienBreux / gist:2427846
Created April 20, 2012 11:17
Remove website (sudo ./removeSite.php <user> <host>)
#!/usr/bin/php
<?php
define('SUCCESS', "\033[32m".'OK'."\033[37m - ");
define('WARN', "\033[31m".'INFO'."\033[37m - ");
define('EOL', "\n");
## FUNCTIONS
function pecho($string) {fwrite(STDOUT, $string);}
@JulienBreux
JulienBreux / .profile
Created April 26, 2012 16:07
Mac Profile
# Alias
alias apache='sudo /opt/local/apache2/bin/apachectl'
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5 &'
alias mysqlstop='sudo /opt/local/bin/mysqladmin5 -u root -p shutdown'
alias ls='ls -G'
alias ll='ls -hl'
# Sources
# Use (http://www.git-attitude.fr/2010/07/14/le-prompt-bash-qui-change-la-vie-avec-git/)
source "$HOME/.git-completion.bash" &&
@JulienBreux
JulienBreux / layout.html
Created August 6, 2012 13:11
HTML5 - Simple layout
<!doctype html>
<!--[if lt IE 7 ]> <html lang="fr" class="lang-fr no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="fr" class="lang-fr no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="fr" class="lang-fr no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="fr" class="lang-fr no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="fr" class="lang-fr no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<?php
function secure(&$value, $key)
{
if ((bool)preg_match('/^[0-9]+$/', $value))
$value = (int)$value;
elseif ((bool)preg_match('/^[0-9]+\.[0-9]+$/', $value))
$value = (float)$value;
else
$value = mysql_real_escape_string($value);
}
@JulienBreux
JulienBreux / compile.sh
Created August 18, 2012 11:41
Compilation: NGINX 1.2.3
./configure
--prefix=/usr/local/nginx
--user=www-data --group=www-data
--without-mail_pop3_module
--without-mail_imap_module
--without-mail_smtp_module
--with-http_stub_status_module
--with-http_ssl_module
--http-log-path=/var/log/nginx/access.log
--conf-path=/etc/nginx/nginx.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEC0w
LjAxNTkyNDQwNTMxIDAuMTI2NTIwOTE2OCAwLjE1OTY5NjAxMjcgMC45NgAQAYAC0hAR
EhNaJGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXll
@JulienBreux
JulienBreux / gist:3833470
Created October 4, 2012 13:18
Opera Shortcut
"C:\Program Files (x86)\Opera\opera.exe" -kioskmode -kioskresetstation -nocontextmenu -nodownload -nocontextmenu -nokeys -nomail -nomaillinks -nomenu -nosave -resetonexit