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 numerosMegaVirada() { | |
const min = 1; | |
const max = 60; | |
const max_numbers = 6; | |
let numbers = []; | |
do { | |
let number = Math.random() * (max - min) + min; | |
if (number >= min && number <= max && !numbers.includes(parseInt(number))) numbers.push(parseInt(number)); | |
} while (numbers.length != max_numbers); |
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 distance(lat, long, lat1, long1, useManhatan) { | |
var r = Math.sqrt; | |
var o = Math.cos; | |
var l = Math.sin; | |
var p = Math.PI; | |
var m = Math.round; | |
var earthCurve = 6371; | |
var manthatanConst = 1.309; |
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
#Força a utilizar Cache-Control e Expires header | |
<IfModule mod_headers.c> | |
Header unset ETag | |
</IfModule> | |
FileETag None | |
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType text/cache-manifest "access plus 0 seconds" | |
# Html |
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
<?php | |
function new_post_thumbnail_meta_box() { | |
global $post; | |
echo '<p class="howto">Tamanho recomendado: 1413px × 640px </p>'; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); | |
echo _wp_post_thumbnail_html( $thumbnail_id ); | |
} | |
function render_new_post_thumbnail_meta_box() { | |
global $post_type; |
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
<?php | |
#Usage | |
add in functions | |
function load_more_button($context = 'default', $text = 'Carregar Mais', $template = 'parts/cards', $paged = 0) | |
{ | |
if (empty($paged)) { | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
} | |
$load_more = new Load_More_Posts(); | |
$load_more->load_more_button($context, $text, $template, $paged); |
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
<?php | |
add_action( 'woocommerce_admin_order_item_headers', 'collumn_invoice_header' ); | |
function collumn_invoice_header($order){ | |
?> | |
<th class="line_produtor_title sortable" data-sort="your-sort-option"> | |
name collumn | |
</th> | |
<?php | |
} |
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
<?php | |
class BulmaWalker extends \Walker_Nav_Menu | |
{ | |
/** | |
* [private stored in start_el and used in start_lvl to pass custom classes on ] | |
* @var [array] | |
*/ | |
private $right_class; |
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
version: '3' | |
# Named volumes | |
volumes: | |
pg-container-data: | |
driver: local | |
redis-container-data: | |
driver: local | |
services: |
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 gerarCPF(a) { | |
var b = !0 | |
, c = 9 | |
, d = randomiza(c) | |
, e = randomiza(c) | |
, f = randomiza(c) | |
, g = randomiza(c) | |
, h = randomiza(c) | |
, i = randomiza(c) | |
, j = randomiza(c) |
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
cfpValido () { | |
const regexCPF = /^\d{3}\.\d{3}\.\d{3}-\d{2}$/ | |
let i = 0 | |
let soma = 0 | |
let resto = 0 | |
if (regexCPF.test(this.cpf)) { | |
for (i = 1; i <= 9; i++) { | |
soma = soma + parseInt(this.cpf.substring(i - 1, i)) * (11 - i) | |
} | |
resto = soma % 11 |
NewerOlder