Skip to content

Instantly share code, notes, and snippets.

View dantetesta's full-sized avatar

DANTE TESTA dantetesta

View GitHub Profile
<script>
jQuery( document ).ready(function() {
var datanascimento = jQuery('#nascimento h2').text();
var idade = calculaIdade(datanascimento);
jQuery('#idade h2').text(idade + ' Anos');
<script>
jQuery(document).ready(function($) {
var delay = 100; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none'); }, delay);
});
</script>
local: body end
add_action( 'rest_api_init', 'create_api_posts_meta_field' );
function create_api_posts_meta_field() {
// register_rest_field ( 'name-of-post-type', 'name-of-field-to-return', array-of-callbacks-and-schema() )
register_rest_field( 'posty_tyepe_name', 'metafields', array(
'get_callback' => 'get_post_meta_for_api',
'schema' => null,
)
);
<script>
jQuery( document ).ready(function() {
function pad(num, size) {
var s = num+'';
while (s.length < size) s = '0' + s;
return s;
}
<script>
var hoje = new Date();
var dia = hoje.getDate();
var ontem = dia-1;
var antiontem = ontem-1;
const mes = new Array();
mes[0] = "Janeiro";
mes[1] = "Fevereiro";
<script>
var hoje = jQuery('.hoje h2').text();
var expire = jQuery('.expire h2').text();
//jQuery('.expire, .hoje').hide();
function compareDates(hoje, expire){
const date1 = new Date(hoje);
const date2 = new Date(expire);
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js" integrity="sha512-adgfzougYIGhG3Tpb47fZLuMwaULLJQdujqOeWFoGc7vwFvBrFkhaPkJPId5swgdr122mghL/ysQk4oiabmRCQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<a id="btn-download" href="#" style="width:300px; text-align:center; display:block; font-size:20px; font-weight:bold; padding:15px; border:2px solid #fd5556; color:white; background:#fd5567">
Fazer Download &nbsp; <i class="fa fa-download"></i></a>
<script>
jQuery("#btn-download").on('click', function () {
html2canvas(document.getElementById("print-area")).then(function (canvas) {
<script>
//Remover o comentário abaixo para ocultar o titulo
//jQuery('#titulo').hide();
jQuery('button[type=submit]').click(function() {
var box1 = jQuery('#box1 option:selected').text();
var box2 = jQuery('#box2 option:selected').text();
<!-- DANTE TESTA TREINAMENTOS WWW.DANTETESTA.COM.BR-->
<!-- Adicionando Javascript -->
<script type="text/javascript" >
/* SETUP DOS IDS DO FORM
*
* Insira os ID's CSS de acordo com os campos do seu formulário.
*
*/
<script>
/* SETUP DOS IDS DO FORM
*
* Insira os ID's CSS de acordo com os campos do seu formulário.
* Desenvolvido por DANTE TESTA
* */
var cnpj='#form-field-cnpj';
var situacao='#form-field-situacao';
var natureza='#form-field-natureza';