Skip to content

Instantly share code, notes, and snippets.

View eduwass's full-sized avatar
❄️
working remotely

Edu Wass eduwass

❄️
working remotely
View GitHub Profile
@razaanstha
razaanstha / acf-block.php
Created December 6, 2023 16:55
ContentEditable - ACF Block
<?php
/**
* Block: Hero
* --------------------------------
* The hero block for all pages.
*/
$block_data = get_fields();
?>
@colorful-tones
colorful-tones / Gutenberg Style Guide
Last active November 28, 2023 11:02
A simple style guide for Gutenberg FSE theme development
<!-- wp:spacer {"height":"150px"} -->
<div style="height:150px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:group {"align":"wide","layout":{"inherit":false}} -->
<div class="wp-block-group alignwide"><!-- wp:columns {"verticalAlignment":"center"} -->
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"3rem","right":"1rem","bottom":"3rem","left":"1rem"}},"border":{"width":"1px"}},"backgroundColor":"contrast","className":"has-border-color has-black-border-color"} -->
<div class="wp-block-column is-vertically-aligned-center has-border-color has-black-border-color has-contrast-background-color has-background" style="border-width:1px;padding-top:3rem;padding-right:1rem;padding-bottom:3rem;padding-left:1rem"><!-- wp:paragraph {"textColor":"base","fontSize":"small"} -->
<p class="has-base-color has-text-color has-small-font-size">Contrast</p>
<!-- /wp:paragraph --></div>
@iamntz
iamntz / readme.md
Last active May 17, 2022 16:15
WP CLI wrapper to run commands on all sites in a network

After you install wp-cli:

If you're on Linux:

  1. Install wpmu wrapper: curl https://gist.githubusercontent.com/iamntz/0018e0535d15e00cf012a18486f102ad/raw/wpms.sh -o /usr/local/bin/wpmu
  2. make it executable: chmod +x /usr/local/bin/wpms
  3. Run commands as you'd normally do, using wpms instead, e.g. wpms plugin list

If you're on Windows:

@alekseykulikov
alekseykulikov / github-actions-ranking.md
Last active August 3, 2021 20:53
Github Actions Ranking (June 18, 2020)

Github Actions is a CI/CD platform that gained a lot of popularity recently. I participated in building ⭐️ Lighthouse CI Action and was curious how well it performs.

But Github Marketplace UI shows no ranking information. Essentially, It's a search with random results; at least, I don't understand the order. I couldn't find ⭐️ Lighthouse CI Action in Continuous integration category after browsing 50 available pages (Each page shows 20 results, so it's possible to see only 1000 results, but CI category has 1469 😐).

I decided to build a custom script that crawls all categories and use Github Search (example query) to estimate usa

#!/usr/bin/env node
const { writeFileSync, readFileSync, unlinkSync } = require('fs')
const package = require('./package.json')
const packageLock = require('./package-lock.json')
const TEMPLATE_GITHUB_REPOSITORY = 'org/template'
const { GITHUB_REPOSITORY } = process.env
@heyfletch
heyfletch / fd-clear-elementor-cache.php
Last active February 14, 2022 14:14
Clear Elementor Cache After a WP Migrate DB Pro Migration - Must Use Plugin (mu-plugins)
<?php
/*
Plugin Name: FD Clear Elementor Cache After WP Migrate DB Migration
Plugin URI: https://gist.github.com/heyfletch/769c64ad1fab8679032b076433afafd1
Description: Deletes CSS in uploads/elementor/css, which auto-regenerates on pageload. This clears the cache locally and remotely. Must-use plugin (mu-plugin).
Author: Fletcher Digital
Version: 0.1.1
Author URI: https://fletcherdigital.com
*/
@joshuafredrickson
joshuafredrickson / no-nags.php
Created January 29, 2019 14:46
WordPress: Move all admin notices and plugin nags to console
add_action('plugins_loaded', function() {
$action = is_user_admin() ? 'user_admin_notices' : 'admin_notices';
add_action($action, function () {
ob_start();
});
add_action('all_admin_notices', function () {
$log = strip_tags(trim(ob_get_clean()));
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active May 3, 2024 12:07
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@marcosnakamine
marcosnakamine / script.js
Created October 24, 2017 13:28
jQuery - WP Smush auto click
setInterval(function(){
botao = jQuery('#wp-smush-bulk-wrap-box > div.box-container > div.wp-smush-bulk-wrapper > button');
if( botao.attr('disabled') != 'disabled' ) {
botao.trigger('click');
}
}, 1000);
@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1