Skip to content

Instantly share code, notes, and snippets.

View clementbiron's full-sized avatar

Clément Biron clementbiron

View GitHub Profile
@martinratinaud
martinratinaud / typescriptreact.json
Last active May 11, 2021 06:39
VSCode Snippet to Create a typescript react functional component
{
"snippet-rf": {
"prefix": "rf",
"body": [
"import React from 'react';",
"import s from './${TM_FILENAME_BASE}.module.css'",
"",
"",
"interface ${TM_FILENAME_BASE}Props {",
" // TODO",
@corsonr
corsonr / attestation-derogatoire.user.js
Last active January 16, 2021 08:59
Génération automatique de l'attestation dérogatoire obligatoire en France pour le confinement V2.
// ==UserScript==
// @name Attestation Derogatoire
// @namespace https://media.interieur.gouv.fr/
// @version 0.1
// @description Auto-génération de l'attestation. Passez le motif en URL, par exemple https://media.interieur.gouv.fr/deplacement-covid-19/?raison=travail
// @author Remi Corson
// @match https://media.interieur.gouv.fr/*
// @require http://code.jquery.com/jquery-latest.js
// @grant none
// ==/UserScript==
@willybahuaud
willybahuaud / debug-hooks.php
Last active January 6, 2022 23:58
debug hooks and filters
<?php
function trace_hooks() {
global $wp_filter;
foreach ( $wp_filter[current_filter()]->callbacks as $f ) {
var_dump( current_filter(), $f );
}
}
add_action( 'all', 'trace_hooks' );
@7studio
7studio / POST.md
Created July 31, 2018 17:00
Créer des raccourcis vers des pages "importantes" dans le menu d'administration de WordPress

Créer des raccourcis vers des pages "importantes" dans le menu d'administration de WordPress

Thistle admin menu page shortcuts

Ce besoin est venu d'une ancienne chef de projet qui en avait marre de chercher certaines pages "importantes" dans la liste des pages 😄 Ça peut se comprendre. Entre nous, avec l'extension Simple Page Ordering, elle aurait pu remonter les pages concernées tout en haut mais pas question (pour tout le monde) de voir la liste des pages dans le plan du site (via wp_list_pages) être impactée par ce choix/besoin côté back-office.

Alors d'un commun accord, nous avons décidé d'ajouter des raccourcis dans le menu "Pages" du back-office de WordPress. Juste entre l'entrée "Toutes les pages" et "Ajouter" pour que ça soit plus "pratique" et "logique" 😅 Je savais que ça risquerait d'être chiant mais j'étais d'accord avec elle 👍 De t

@herewithme
herewithme / acf-functions-helper.php
Last active February 14, 2018 07:58
ACF template helper - Checks if at least one field is completed by BO for display or not a block
<?php
/**
* This function checks if at least one field is completed by BO
*
* @param array|string $fields the list of ACF fields to test, an array or a string of text separated by a comma
* @param mixed $object the post_id of which the value is saved against
* @param bool $is_sub_field
*
* @return bool
*/
@jessepearson
jessepearson / add_bcc_to_certain_emails.php
Created October 31, 2016 17:19
Add a BCC to certain defined emails sent from WooCommerce
<?php // only copy this line if needed
/**
* Function adds a BCC header to emails that match our array
*
* @param string $headers The default headers being used
* @param string $object The email type/object that is being processed
*/
function add_bcc_to_certain_emails( $headers, $object ) {
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 16, 2024 15:33
Vanilla JavaScript Quick Reference / Cheatsheet
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@BenMorel
BenMorel / viewport-units-ios.scss
Last active March 11, 2022 13:15
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
@SebCorbin
SebCorbin / Enregistrer la selection en SVG.jsx
Created April 7, 2015 14:25
Illustrator script - Save selection as SVG
/*
* Export selection to SVG - export_selection_as_SVG
* (Adapted from Layers to SVG 0.1 - export_selection_as_SVG.jsx, by Rhys van der Waerden)
*
* @author SebCorbin
*/
// Variables
var ignoreHidden = true,
svgExportOptions = (function () {