Skip to content

Instantly share code, notes, and snippets.

Avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / DbFactory.php
Created Apr 2, 2012
PrestaShop 1.5.x - Database Factory
View DbFactory.php
<?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 Apr 2, 2012
PrestaShop 1.5.x - Module override in themes
View BlockTags.php
<?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 Apr 20, 2012
Add website (sudo ./addSite.php <user> <host> <alias>)
View gist:2427844
#!/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 Apr 20, 2012
Remove website (sudo ./removeSite.php <user> <host>)
View gist:2427846
#!/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);}
View .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 Aug 6, 2012
HTML5 - Simple layout
View layout.html
<!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">
View IO-prevent.php
<?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 Aug 18, 2012
Compilation: NGINX 1.2.3
View compile.sh
./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
View Solarized Dark.terminal
<?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
View gist:3833470
"C:\Program Files (x86)\Opera\opera.exe" -kioskmode -kioskresetstation -nocontextmenu -nodownload -nocontextmenu -nokeys -nomail -nomaillinks -nomenu -nosave -resetonexit