Skip to content

Instantly share code, notes, and snippets.

View michelmany's full-sized avatar

Michel Moraes michelmany

View GitHub Profile
@vovafeldman
vovafeldman / fs-my-addon.php
Created March 26, 2016 20:25
Example of an add-on with Freemius that is activated only when the parent plugin is activated and loaded.
<?php
/*
Plugin Name: My Add-on
Version: 1.0.0
Author: Vova Feldman
Author URI: http://freemius.com
License: GPL2
*/
// Exit if accessed directly
@dgoze
dgoze / gist:95310ee1449b4632ca13cb6c1cce5c78
Created April 29, 2016 22:24 — forked from martinsanne/gist:72f48bad22d99032ba0e
WordPress ACF Multisite location rule
<?php
/**
*
* Adds location rule to target specific sites in a WordPress Multisite environment
* http://www.advancedcustomfields.com/resources/custom-location-rules/
*
*/
function acf_location_rule_type_blog( $choices ) {
@zgordon
zgordon / enqueue-block-js-and-css-plugin.php
Last active September 27, 2022 09:26
Example plugin file for enqueueing Gutenberg block JS and CSS
<?php
/**
* Enqueue block editor JavaScript and CSS
*/
function jsforwpblocks_editor_scripts() {
// Make paths variables so we don't write em twice ;)
$blockPath = '/assets/js/blocks.js';
$editorStylePath = '/assets/css/blocks.editor.css';
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active May 13, 2025 15:54
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active April 29, 2025 08:30
Byte formatting for Google Sheets
@geoffyuen
geoffyuen / _webp.twig
Last active May 12, 2020 12:36
Webp with fallback for Timber/Twig
{% spaceless %}
{#
This Timber twig will output an <picture> with fallbacks, srcset x2, alt, width and height
Usage:
`{% include '_webp.twig' with { class: "db ma0 center w-100", img: Image(post.acf_image), w: 507, h: 507 } %}`
@params