Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mário Valney mariovalney

🏠
Working from home
View GitHub Profile
@mariovalney
mariovalney / image-selector-example.js
Last active Jul 11, 2021
WordPress - Gutenberg Image Selector Component
View image-selector-example.js
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 Dec 23, 2020
AIFW - Will create categories if not found.
View aifw-create-categories.php
<?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 Oct 20, 2020
Send webhook to Airtable API
View cf7-to-webhook-air-table.php
<?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 Sep 17, 2020
Add dropdown classes to your wp_nav_menu() output
View bootstrap-dropdown-wp-nav-menu.php
<?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 Jul 12, 2020
Add data to select of Contact Form 7 like Listo
View cf7-custom-select.php
<?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 Jun 9, 2021
Add Cookies data to webhook
View cf7-to-webhook-add-cookies.php
<?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 Jun 16, 2020
Format data to send a webhook to discord
View cf7-to-webhook-discord-integration.php
<?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 Mar 7, 2020
Creates a desktop entry on /usr/share/applications
View create-shortcut.sh
#!/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
Runs a build and publish to WP Engine Git Push
View bitbucket-pipelines.yml
image: node:lts
pipelines:
default:
- step:
caches:
- node
deployment: staging
name: Deploy to Staging
script:
@mariovalney
mariovalney / docker-compose.yml
Created Feb 6, 2020
Docker Compose to WordPress + Mailhog + Database + Network
View docker-compose.yml
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
- "3306:3306"
volumes: