Skip to content

Instantly share code, notes, and snippets.

View ipatate's full-sized avatar
🏠
Working from home

Patrick Faramaz ipatate

🏠
Working from home
View GitHub Profile
@ipatate
ipatate / index.html
Last active October 9, 2023 13:31
Variation exemple Block Query
<!-- encore plus simple avec juste le namespace dans les commentaires, pas besoin de variation js normalement -->
<!-- wp:query {"queryId":1,"query":{"perPage":100,"pages":0,"offset":0,"postType":"post","order":"asc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","taxQuery":{},"inherit":false},"namespace":"namespace/variation-name","align":"wide","className":"..."} -->
<div class="wp-block-query alignwide ..."><!-- wp:post-template {"layout":{"type":"grid","columnCount":3}} -->
<!-- wp:group {"align":"wide"} -->
<div class="wp-block-group alignwide"><!-- wp:post-featured-image {"isLink":true} /-->
<!-- wp:post-title {"textAlign":"left","level":3} /-->
<!-- wp:post-excerpt {"excerptLength":50} /-->
{
"version": 2,
"settings": {
// Setting that enables the following UI tools:border: color, radius, style, width, color: link, spacing: blockGap, margin, padding, typography: lineHeight
"appearanceTools": true,
// Settings related to borders
"border": {
color: false,
radius: false,
style: false,
<?php
// in functions file
// require_once(dirname(__FILE__) . '/field.php');
// gm-field-name is name for input in front
// gm-show-name-field is name of input in back
namespace Goodmotion\inc\woocommerce\field;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
@ipatate
ipatate / canIUseWebp.js
Created October 6, 2020 09:38
Function for detecting support of webp
// thank http://jsfiddle.net/Schepp/uZDHY/ for idea
const canIUseWebp = () => {
return new Promise((resolve, reject) => {
// create image
const webp = new Image();
// detect if browser can read format
webp.onerror = () => reject('Your browser does not suppoert WebP');
webp.onload = () => resolve('Your browser supports WebP, yay!');
// just 1px blank webp image
webp.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAsBMJaQAA3AA/veMAAA=';

id: amaretti title: Amaretti price: 6 tva: TVA 5.5 quantity: 100 unit: grammes categories:

  • src/content/categories/biscuits.md image: "../../uploads/Amaretti.jpg"
// https://github.com/gaearon/redux-thunk
export function updateTitleMeta(value) {
return (dispatch, getState) => {
const state = getState();
const head = state.header;
head.title = value;
return dispatch(addToHeader(head));
};
}