Skip to content

Instantly share code, notes, and snippets.

View Plou's full-sized avatar

Plou Plou

View GitHub Profile
@Plou
Plou / exemples.md
Created December 11, 2017 09:25
AppChat Workshop

Initiation web

AppChat

HTML

Balises & attributs

<html>
@Plou
Plou / gulpfile.js
Last active September 7, 2018 04:43
Gulp4 : pug + l11n + scss + babel + react + + express
const gulp = require('gulp')
const batch = require('gulp-batch')
const plumber = require('gulp-plumber')
const notify = require('gulp-notify')
const gutil = require('gulp-util')
const source = require('vinyl-source-stream')
const buffer = require('vinyl-buffer')
const pug = require('gulp-pug')
const sass = require('gulp-sass')
const postcss = require('gulp-postcss');
@Plou
Plou / App.css
Last active October 26, 2016 13:58
* {
box-sizing: border-box;
}
.App {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
<?php
// Ajoute l'image à la une aux pages et articles
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1200, 800, true );
// Déclare des tailles d'images
function image_size() {
add_image_size( 'post-list', 600, 200, true );
}
@Plou
Plou / gist:72f540f86ad872de3b16
Created February 25, 2016 15:11
content.php
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
@Plou
Plou / banner.php
Last active September 8, 2023 21:20
<?php
// Récupère l'image de la page blog dans les listes
$bannerImg = get_the_post_thumbnail_url(is_home() ? get_option( 'page_for_posts' ) : null, 'large');
?>
@Plou
Plou / functions.php
Last active December 1, 2015 11:12
Get month and years from list of custom post in wp
<?php
$yearsStart = $wpdb->get_col("SELECT YEAR(FROM_UNIXTIME((meta_value / 1000))) FROM wp_postmeta WHERE meta_key LIKE 'start_date' ORDER BY meta_value ASC");
$yearsEnd = $wpdb->get_col("SELECT YEAR(FROM_UNIXTIME((meta_value / 1000))) FROM wp_postmeta WHERE meta_key LIKE 'end_date' ORDER BY meta_value ASC");
$tempyears = array_unique(array_merge($yearsStart, $yearsEnd));
$currentYear = date('Y');
$currentMonth = date('m');
foreach (array_unique($yearsStart) as $year) {
if($year >= $currentYear) {
@Plou
Plou / dummysay.js
Last active November 24, 2015 14:40
Replace the yosay from yeoman with our dummy
/*
|¯¨´ `¨¯| .-----------------------.
\ ` ´ / | This script |
\ ` ´ / | will output |
' `´ ' | something like this |
/ ´ ` \ | dummy-team.github.io |
| dummy `| '-----------------------'
`~------~´
@Plou
Plou / compress.coffee
Created November 18, 2015 11:51
Compress grunt task configuration
name = require('optimist').argv.name
if name
name = '../export/' + name + '.zip'
else
now = new Date()
Y = now.getFullYear()
M = now.getMonth()+1
D = now.getDate()
H = now.getHours()
name = '../export/music-story-static-'+Y+'-'+M+'-'+D+'-'+H+'h.zip'
function Class(variante) {
this.methods[variante]
return this;
}
Class.prototype.bar = function(a, b) {
return a + b;
};
Class.prototype.methods = {
bim: function() {