Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Demonchy fusco

🎯
Focusing
Block or report user

Report or block fusco

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fusco
fusco / nginx.conf
Created Nov 29, 2015 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View totals.phtml
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
View config.xml
<?xml version="1.0"?>
<!--
/*
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to contact@mageho.com so we can send you a copy immediately.
View Cart.php
<?php
class Cart extends CartCore
{
public function __construct($id = NULL, $id_lang = NULL)
{
parent::__construct($id, $id_lang);
/* Oleacorner : Optimization of producst cache management in case several cart objects with same IDs are created */
@fusco
fusco / new_store.phtml
Created Jul 13, 2012
remplace dropdown store menu by flag
View new_store.phtml
<?php if(count($this->getGroups())>1): ?>
<div class="store-switcher">
<?php foreach ($this->getGroups() as $_group): ?>
<a href="<?php echo $_group->getHomeUrl() ?>"><img
src="<?php echo $this->getSkinUrl('images/store/store_' . strtolower(str_replace(' ', '_',$this->htmlEscape($_group->getName()))) . '.png') ?>" width="30" height="20"
alt="<?php echo $this->htmlEscape($_group->getName()) ?>"/></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
View cms.xml
<block type="catalog/product_list" name="home" template="catalog/product/home.phtml">
<action method="setCategoryId">
<category_id>53</category_id>
</action>
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName">
<name>product_list_toolbar</name>
</action>
View gist:3021639
public function updatefile($merchant_id,$BankServer,$nom_logo){
// fonction qui va écrire/réécrire le fichier /param/pathfile et /param/parmcom........
$pathfile=dirname(__FILE__)."/param/pathfile";
$comfile =dirname(__FILE__)."/param/parmcom.".$merchant_id;
@unlink($pathfile);
$fp=fopen($pathfile, "w");
$return = true;
if($fp){
fwrite($fp,"DEBUG!NO!\n");
fwrite($fp,"D_LOGO!".__PS_BASE_URI__."modules/".$this->name."/logo/!\n");
View config.php
/* Debug only */
@ini_set('display_errors', 'on');
/*
define('_PS_DEBUG_SQL_', true);
*/
$start_time = microtime(true);
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
View req.sql
$sql .= ($first ? "" : ", ") . "(" . (intval($category['categories_id']) + 1) . ", " . $category['parent_id'] . ", " . $category['level_depth'] . ", " . (isset($category['categories_status']) ? intval($category['categories_status']) : 1) . ", '" . $category['date_added'] . "', '" . $category['last_modified'] . "'".($ps_version >= 1.4 ? ', '.((isset($category['sort_order']) AND $category['sort_order']) ? $category['sort_order'] : '0') : '').")";
View article.rb
class Article < ActiveRecord::Base
belongs_to :employee, :foreign_key => :employee_id
# require gem globalize3
translates :title, :content, :permalink, :keyword, :description
attr_accessible :title, :content, :keyword, :description, :published_at, :published, :comment_status, :employee_id, :status
before_validation :define_permalink
validates_presence_of :title, :content, :keyword, :description, :published_at
You can’t perform that action at this time.