Skip to content

Instantly share code, notes, and snippets.


Márcio Duarte pagelab

View GitHub Profile
pagelab / script.js
Created Feb 8, 2021
Remove random itens on the WordPress Tag Cloud Widget.
View script.js
(function ($) {
"use strict";
$(function () {
$( 'a.tag-cloud-link' ).each(function( index ) {
var index = Math.round( Math.random() * 1 );
$( this ).eq( index ).hide();
pagelab / batch_pandoc_win.bat
Created Feb 17, 2020 — forked from mmparker/batch_pandoc_win.bat
Batch conversion of .markdown to .html on Windows command line
View batch_pandoc_win.bat
REM This file converts all of the Markdown files to HTML.
REM Converting in the current directory
REM %%~ni returns just the filename of %%i, not its extension
for %%i in (*.markdown) do pandoc -f markdown -t html5 %%~ni.markdown > html/%%~ni.html
REM Converting a subdirectory - just slap it on front
for %%i in (report_pages/*.markdown) do pandoc -f markdown -t html5 report_pages/%%~ni.markdown > html/report_pages/%%~ni.html
pagelab / html2docx.bat
Created Feb 17, 2020 — forked from arthurattwell/html2docx.bat
Batch file to convert HTML files to Word docx with Pandoc
View html2docx.bat
:: This batch file converts HTML files in a folder to docx.
:: It requires Pandoc, and a list of files to convert
:: named file-list, in which each file is on a separate line,
:: and contains no spaces in the filename.
:: Don't show these commands to the user
@ECHO off
:: Set the title of the window
TITLE Convert html to docx
:: This thing that's necessary.
pagelab /
Created Feb 17, 2020 — forked from d6y/
Batch convert HTML to Markdown
# Converts HTML from exports to Markdown
for file in $POSTS_DIR/*.html
echo $file
pagelab / phoneValidate_BR.php
Created Jan 29, 2020 — forked from boliveirasilva/phoneValidate_BR.php
Regex para validação de telefones (celular ou fixo) no Brasil. A expressão leva em conta o formato internacional/nacional, com ou sem o DDD, de telefones fixos e celulares.
View phoneValidate_BR.php
// A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil.
// Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1.
// Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888
function phoneValidate($phone)
$regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/';
if (preg_match($regex, $phone) == false) {
pagelab / acf-flip-card.json
Created Jan 6, 2020 — forked from damiencarbery/acf-flip-card.json
Flip Card block with ACF Pro - Create a custom Gutenberg block for 3D hover animation -
View acf-flip-card.json
"key": "dcwd_flip_card_group",
"title": "Flip Card",
"fields": [
"key": "front_image",
"label": "Front image",
"name": "card_front",
"type": "image",
"return_format": "array",
pagelab / how-not-to-use-wp-filter.php
Created Jan 6, 2020 — forked from damiencarbery/how-not-to-use-wp-filter.php
Use $wp_filter global to view functions attached to actions and filters
View how-not-to-use-wp-filter.php
Plugin Name: wp_filter functions
Plugin URI:
Description: List functions attached to all actions and filters. DON'T DO IT!
Author: Damien Carbery
Version: 0.1
add_action( 'wp_head', 'wp_filter_the_wrong_way' );
View Alternativas ao Zapier.txt
AWS Lambda
View wc-ninja-conditional-checkout-fields.php
* Plugin Name: Conditional WooCommerce Checkout Fields
* Description: Adds the abilitiy to conditionally show / hide checkout fields.
* Version: 1.0
* Author: Caleb Burks
* Author URI:
pagelab / skip-to-check-out.php
Created Oct 8, 2019 — forked from micc83/skip-to-check-out.php
Skip cart and redirect to direct checkout on WooCommerce
View skip-to-check-out.php
* Skip cart and redirect to direct checkout
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
// Skip the cart and redirect to check out url when clicking on Add to cart