This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var watch = require('gulp-watch'); | |
var concat = require('gulp-concat'); | |
var cleanCSS = require('gulp-clean-css'); | |
sass.compiler = require('node-sass'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Adiciona máscara em CPF e CNPJ no mesmo campo | |
Caso precise você pode mudar o seletor para usar um ID ou class. | |
Fonte: https://jsfiddle.net/pdd8g4mf/ | |
*/ | |
var CpfCnpjMaskBehavior = function (val) { | |
return val.replace(/\D/g, '').length <= 11 ? '000.000.000-009' : '00.000.000/0000-00'; | |
}, | |
cpfCnpjpOptions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Função para criar usuário administrador no WordPress via FTP | |
* | |
* @since 17/04/2018 | |
* @see https://brasa.art.br/como-adicionar-um-usuario-no-wordpress-pelo-ftp/ | |
* @return void | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Função para retornar tag <span> com ícone da biblioteca Glyphicons | |
* | |
* @author Everaldo Matias <http://everaldomatias.github.io> | |
* @version 0.1 | |
* @since 22/02/2018 | |
* @link https://gist.github.com/everaldomatias/e3f7af6eaa19037d7046c39f6c860390 | |
* @param $icon string que irá receber a especificação do ícone | |
* @example <?php echo get_glyphicon( 'glyphicon-heart' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Redirect single result search in WP. | |
* @author Everaldo Matias <[email protected]> | |
*/ | |
add_action( 'template_redirect', 'redirect_single_result_search' ); | |
function redirect_single_result_search() { | |
if ( is_search() ) { | |
global $wp_query; | |
if ( $wp_query->post_count == 1 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS | |
jQuery(function() { | |
jQuery('.add-request-quote-button').on('click', function() { | |
jQuery.ajax({ | |
type : 'POST', | |
url : 'wp-admin/admin-ajax.php', | |
dataType: 'json', | |
data : action_agp_qdt_itens, | |
success: function (response) { | |
jQuery('#raq_item_number').addClass('teste'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/aikiframework/json.git --recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cria a tabela Configuracoes se não existir | |
$conexao_configuracoes = mysqli_connect( $host, $user, $pass, $banco ) or die( "ERROR : " . mysqli_error() ); | |
$configuracoes = "configuracoes"; | |
$cria_configuracoes = $conexao_configuracoes->query("CREATE TABLE IF NOT EXISTS $configuracoes( | |
ID int NOT NULL AUTO_INCREMENT, | |
PRIMARY KEY(ID), | |
km_inicial VARCHAR(50) NOT NULL, | |
data_inicial DATE NOT NULL, | |
valor_compra VARCHAR(50) NOT NULL | |
)"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mobile_home_redirect(){ | |
if( wp_is_mobile() && is_front_page() ){ | |
include( get_stylesheet_directory() . '/index-mobile.php' ); | |
exit; | |
} | |
} |