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
#include "OneWire/OneWire.h" | |
#include "MQTT/MQTT.h" | |
// ONE WIRE | |
OneWire one = OneWire(D0); | |
uint8_t rom[8]; | |
uint8_t resp[9]; | |
// AVERAGE TEMPERATURE | |
const int temperatureManySamples = 5; |
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
homeassistant: | |
# Name of the location where Home Assistant is running | |
name: Home | |
# Location required to calculate the time the sun rises and sets | |
latitude: ****** | |
longitude: ****** | |
# C for Celcius, F for Fahrenheit | |
temperature_unit: C | |
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones | |
time_zone: America/Sao_Paulo |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
DELETE FROM wp_posts WHERE post_type = 'product'; |
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 a Cidade do empreendimento | |
function get_cidade(){ | |
global $post; | |
$taxonomy = 'localizacao'; | |
$estados; | |
$cidade = []; | |
$bairro; | |
// busca termos que não tem parents, esses são os estados | |
$estados = get_terms( $taxonomy, array( 'parent' => 0 ) ); |
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 $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?> | |
<?php echo $feat_image; ?> |
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
// Retorna uma string com a quantidade de caracteres especificadas provindas do conteúdo do post | |
// sempre cortando a string em um espaço em branco para não cortar uma palavra pela metade | |
function get_excerpt( $count ){ | |
// puxa a variáel global do post | |
global $post; | |
// puxa o ID do post | |
$post_id = $post->ID; |
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
UPDATE wp_posts SET post_content = REPLACE ( | |
post_content, | |
'Item to replace here', | |
'Replacement text here'); |
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
// ref: https://varvy.com/pagespeed/defer-loading-javascript.html | |
function downloadJSAtOnload() { | |
const scripts = ['defer.js', 'defer2.js', 'defer3.js']; | |
scripts.forEach(function(script){ | |
const element = document.createElement("script"); | |
element.src = script; | |
document.body.appendChild(element); |
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
<!--[if gte mso 9]> | |
<table cellspacing=0><tr><td style="font-family: Arial; font-size: 10pt; color: #fff; background-color: orange; width: 250px; height: 100px; padding: 3px; vertical-align: top"> | |
<![endif]--> | |
<div style="float: left; font-family: Arial; font-size: 10pt; color: #fff; background-color: orange; width: 250px; height: 100px; padding: 3px; vertical-align: top"> | |
<strong>{Display name}</strong><br>Phone {Phone}<br>Email <a href="mailto:{E-mail}" style="color: #fff; text-decoration: none;">{E-mail}</a> | |
</div> | |
<!--[if gte mso 9]> | |
</td><td style="font-family: Arial; font-size: 10pt; color: #fff; background-color: red; width: 250px; height: 100px; padding: 3px; vertical-align: top"> | |
<![endif]--> | |
<div style="float: left; font-family: Arial; font-size: 10pt; color: #fff; background-color: red; width: 250px; height: 100px; padding: 3px; vertical-align: top"> |
OlderNewer