Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Oliviercreativ's full-sized avatar

Démontant Oliviercreativ

View GitHub Profile
@Oliviercreativ
Oliviercreativ / code.scss
Created September 6, 2022 13:09 — forked from rohanb10/code.scss
Staggered Delays for Animations in SCSS
/**
* @param $interval - The interval between each delay, defaults to 500ms
* @param $startTime - The start time of the animations, defaults to 0ms
* @param $numberOfDelays - The total number of delays to be generated, defaults to 10
*/
@mixin delays($interval: 500, $startTime: 0, $numberOfDelays: 10) {
@for $i from 0 through $numberOfDelays {
$ms : $startTime + ($i * $interval);
&.delay-#{$ms} {
animation-delay: #{$ms}ms;
/* Convert the standard WooCommerce products list into a modern responsive grid. */
ul.products {
--grid-gap: 32px;
--auto-grid-min-size: 200px;
grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
grid-gap: var(--grid-gap);
display: grid;
}
ul.products:before{
content:unset!important;
@Oliviercreativ
Oliviercreativ / gist:38d2248f49f054c46e6a45021fb91b7c
Created July 25, 2022 14:06 — forked from adamrosloniec/gist:58467267db06603dca73ff222e4b2e50
Wordpress with ACF - add background color to category / categories
function add_blog_category_color(){
$categories = get_categories(array( 'hide_empty' => 0, ));
if ( ! empty( $categories ) ) {
echo '<style type="text/css">';
foreach( $categories as $category ) {
$category_taxonomy = $category->taxonomy;
$category_id = $category->term_id;
$category_slug = $category->slug;
$category_color = get_field('blog_category_color',$category_taxonomy . '_' . $category_id);
@Oliviercreativ
Oliviercreativ / woocommerce-optimize-scripts.php
Created March 25, 2022 12:07 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@Oliviercreativ
Oliviercreativ / woocommerce-optimize-scripts.php
Created March 25, 2022 12:07 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@Oliviercreativ
Oliviercreativ / Show-inventory Quantity Shopify
Created March 4, 2022 09:08 — forked from enamhasan/Show-inventory Quantity Shopify
Display variant inventory quantiy on product page Shopify
# add this script in product liquid (Just before addtocart form)
<!-- Code added for Inventory in Pipeline -->
<script>
var inv_qty = {};
{% for var in product.variants %}
inv_qty[{{- var.id -}}] = {{ var.inventory_quantity | default: 0 }};
{% endfor %}
</script>
{% if current_variant.inventory_management == "shopify" %}
@Oliviercreativ
Oliviercreativ / form-content.html
Created February 16, 2022 23:04 — forked from alexmustin/form-content.html
WordPress AJAX Live Search of Post Title
<!-- // The HTML (could be part of page content) // -->
<input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input>
<div id="datafetch">Search results will appear here</div>
@Oliviercreativ
Oliviercreativ / ICS.php
Created February 10, 2022 23:49 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@Oliviercreativ
Oliviercreativ / gw-gravity-forms-dynamic-select.php
Created May 2, 2021 16:13 — forked from spivurno/gw-gravity-forms-dynamic-select.php
Gravity Wiz // Gravity Forms // Dynamic Select (for Categories, Taxonomies and more)
<?php
/**
* Gravity Wiz // Gravity Forms // Dynamic Category Select
*
* Allows the user to drill down from a top level category to a child category.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/.../
@Oliviercreativ
Oliviercreativ / TweetBox.py
Last active April 1, 2018 07:56
Capturez et Tweetez en appuyant sur un bouton
import tweepy
import picamera
from time import sleep
import RPi.GPIO as GPIO
# Consumer keys and access tokens, used for OAuth
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''