Skip to content

Instantly share code, notes, and snippets.

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

Mário Valney mariovalney

🏠
Working from home
View GitHub Profile
@mariovalney
mariovalney / image-selector-example.js
Last active July 11, 2021 18:34
WordPress - Gutenberg Image Selector Component
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { InnerBlocks, InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { PanelBody } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import ImageSelector from './image-selector';
registerBlockType( 'mariovalney/image-selector-example', {
apiVersion: 2,
@mariovalney
mariovalney / aifw-create-categories.php
Created December 23, 2020 19:28
AIFW - Will create categories if not found.
<?php
/**
* Plugin Name: AIFW Create Categories
* Description: Will create categories if not found.
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: aifw-create-categories
*
* @link https://github.com/mariovalney/api-improver-for-woocommerce
@mariovalney
mariovalney / cf7-to-webhook-air-table.php
Created October 20, 2020 12:11
Send webhook to Airtable API
<?php
/**
*
* Plugin Name: CF7 to Webhook - Airtable
* Description: Send webhook to Airtable API
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: cf7-to-webhook-air-table
*/
@mariovalney
mariovalney / bootstrap-dropdown-wp-nav-menu.php
Created September 17, 2020 22:04
Add dropdown classes to your wp_nav_menu() output
<?php
/**
* Plugin Name: Bootstrap Dropdown on WP Nav Menu
* Description: Add dropdown classes to your wp_nav_menu() output
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: bootstrap-dropdown-wp-nav-menu
*/
@mariovalney
mariovalney / cf7-custom-select.php
Created July 12, 2020 16:06
Add data to select of Contact Form 7 like Listo
<?php
/**
* Plugin Name: CF7 Custom Select
* Description: Add data to select like Listo
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: cf7-custom-select
*/
@mariovalney
mariovalney / cf7-to-webhook-add-cookies.php
Last active June 9, 2021 18:55
Add Cookies data to webhook
<?php
/**
*
* Plugin Name: CF7 to Webhook - Add Cookies
* Description: Add Cookies data to webhook
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: cf7-to-webhook-add-cookies
*/
@mariovalney
mariovalney / cf7-to-webhook-discord-integration.php
Last active April 1, 2024 22:21
Format data to send a webhook to discord
<?php
/**
*
* Plugin Name: CF7 to Webhook - Discord Integration
* Description: Format data to send a webhook to discord
* Version: 1.0.0
* Author: Mário Valney
* Author URI: https://mariovalney.com
* Text Domain: cf7-to-webhook-discord-integration
*
@mariovalney
mariovalney / create-shortcut.sh
Created March 7, 2020 15:22
Creates a desktop entry on /usr/share/applications
#!/bin/bash
set -euo pipefail
# Common variables
BL=$'\n'
SELECT_YES="YES"
SELECT_NO="NO"
SELECT_OVERWRITE="Overwrite"
SELECT_EXIT="Exit"
@mariovalney
mariovalney / bitbucket-pipelines.yml
Last active May 18, 2021 01:08
Runs a build and publish to WP Engine Git Push
image: node:lts
pipelines:
default:
- step:
caches:
- node
deployment: staging
name: Deploy to Staging
script:
@mariovalney
mariovalney / docker-compose.yml
Created February 6, 2020 23:07
Docker Compose to WordPress + Mailhog + Database + Network
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
- "3306:3306"
volumes: