Skip to content

Instantly share code, notes, and snippets.

View fmoutawe's full-sized avatar

Flavien Moutawe fmoutawe

View GitHub Profile

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@fmoutawe
fmoutawe / Dockerfile
Created September 1, 2018 17:44 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@fmoutawe
fmoutawe / concevoir-projet.txt
Last active June 7, 2017 08:33
Concevoir un projet Drupal
# Concevoir un projet Drupal
## Prérequis
* L’utilitaire CLI Drush permettant de manipuler Drupal plus facilement
* Un serveur Web opérationnel (Apache / PHP / MySQL de préférence)
## Initialisation
* Choix de la distribution (classique, commerce, …)
* Etendre le profil d’installation de la distribution et configurer au besoin
* Ce profil d’installation est considéré comme un module à part entière, il peut
@fmoutawe
fmoutawe / dabblet.css
Created June 10, 2014 15:27 — forked from anonymous/dabblet.css
Whe are all chibre
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:bold);
/* Wrapper ------------------------------------------------------ */
#wrapper {
text-align: center;
font-weight: bold;
font: 62.5%/1 "Yanone Kaffeesatz", "Lucida Grande", Lucida, Verdana, sans-serif;
margin: 0 auto;
@fmoutawe
fmoutawe / gist:7351471
Created November 7, 2013 09:07
Write fast php with Drupal
<?php
$keys = array_keys($css);
$data = '';
foreach($keys as $key){
$data .= 'unset($css[' . "'$key'])\n";
}
dpm($data);
@fmoutawe
fmoutawe / mymodule.page.php
Created November 5, 2013 16:17
Make page template in our module
<?php
function mymodule_theme() {
return array(
'page--mymodule' => array(
'render element' => 'node',
'template' => 'page--mymodule',
'path' => drupal_get_path('module', 'mymodule') . '/templates',
),
);
<?php
/**
* @file
* class for MoshioshiUser
*/
class MoshiMoshiUser {
const WEB_DIRECTORY = 'public_html';
const USER_PREFIX = 'moshimoshiuser';
@fmoutawe
fmoutawe / template.php
Last active December 23, 2015 07:19
Add a theme suggestion into your theme
<?php
function theme_preprocess_page(&$vars){
$arg1 = arg(1);
$arg2 = arg(2);
$arg3 = arg(3);
if(isset($vars['node'])){
if(!in_array($arg2, array('edit')) && is_numeric($arg1)){
$vars['theme_hook_suggestions'][] = 'page__node__' . $vars['node']->type;
<?php
/**
* Implements hook_rules_action_info().
*/
function commerce_extra_rules_action_info() {
return array(
'ascomedia_commerce_extra_line_item_tax_component_delete' => array(
'label' => t('Restore default price'),
'parameter' => array(
@fmoutawe
fmoutawe / tax_rate_from_tax_reference.php
Created September 9, 2013 13:51
Add Tax Rate on product from a field Tax Reference (field_tva).
<?php
/**
* Implements hook_commerce_product_calculate_sell_price_line_item_alter();
*/
function custom_commerce_product_calculate_sell_price_line_item_alter(&$line_item){
$name = '';
$products = field_get_items('commerce_line_item', $line_item, 'commerce_product');
foreach($products as $delta => $product){
$product_id = $product['product_id'];