Skip to content

Instantly share code, notes, and snippets.

View unwiredtech's full-sized avatar

Patrick Sarmiento unwiredtech

View GitHub Profile
@unwiredtech
unwiredtech / elementor-form-color.js
Created October 31, 2024 18:09
Elementor Form when diffirent color on different state
document.addEventListener('DOMContentLoaded', function() {
// Select all inputs and textareas within the form
const inputs = document.querySelectorAll('.elementor-form-fields-wrapper input[type="text"], .elementor-form-fields-wrapper input[type="email"], .elementor-form-fields-wrapper textarea');
// Loop through each input
inputs.forEach(input => {
// Add an event listener for input change
input.addEventListener('input', function() {
if (input.value.trim() !== "") {
@unwiredtech
unwiredtech / esphome-8266-sdm230-reader.yaml
Last active October 10, 2024 20:22
Home Assistant and Eastron Energy Meter Communication
esphome:
name: sdm230_modbus_reader
platform: ESP8266
board: nodemcuv2 # For NodeMCU v3
# Wi-Fi connection setup
wifi:
ssid: !secret wifi_ssid_iot
password: !secret wifi_password_iot
@unwiredtech
unwiredtech / esp-pwm-temp-controller.yaml
Created September 25, 2024 10:52
ESPHome - Temperature controlled PWM
esphome:
name: esp-pwm-temp-controller
friendly_name: ESP-PWM-Temp-Controller
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
//Device type Router
//Zigbee Model - TS0601
//Zigbee Manufacturer - _TZE204_lb0fsvba
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;
@unwiredtech
unwiredtech / Flatpickr-init.js
Created August 2, 2024 13:22
Flatpickr-init.js
document.addEventListener("DOMContentLoaded", function() {
var startDateInput = document.getElementById("start_date");
var endDateInput = document.getElementById("end_date");
var startDateDisplayInput = document.getElementById("start_date_display");
var endDateDisplayInput = document.getElementById("end_date_display");
function setDateInputs(startDate, endDate) {
var startDateISO = startDate ? formatDateYMD(startDate) : '';
var endDateISO = endDate ? formatDateYMD(endDate) : '';
@unwiredtech
unwiredtech / search-metafields.php
Created March 20, 2024 15:53
Adds teh metafield as additional search source for Wordpress Search / JetSmartFilter - Wordpress Search
/* Dev500 - Patrick
* March 19, 2024
* @functions.php
* @page /?s
* Adds teh metafield as additional search source for Wordpress Search / JetSmartFilter - Wordpress Search
*/
// Modify the main WordPress query
function custom_search_filter($query) {
@unwiredtech
unwiredtech / custom-select-arrow.css
Created June 8, 2023 01:36
Custom Select Arrow
.jet-form__field.select-field {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: url(data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%238C98F2'><polygon points='0,0 100,0 50,50'/></svg>) no-repeat;
background-size: 12px;
background-position: calc(100% - 20px) 18px;
background-repeat: no-repeat;
background-color: #fff;
}
jQuery(function() {
// console.log('jQuery initialize')
jQuery.initialize('.elementor-message.elementor-message-success', function() {
//hide the section of the notification
jQuery('#grow-aba-lp-form').hide();
//When changes happened, show the notification
@unwiredtech
unwiredtech / slider-toggle-extracontent.js
Created August 30, 2022 12:16
Extra Content Slides on Click
<style>
section.slide-extra-content{
display: none;
position: absolute;
margin-left: 0;
margin-right: 0;
bottom: 0;
max-width: 92%;
}
@media screen and (max-width:1024px){
@unwiredtech
unwiredtech / scroll-to-top-btn.js
Last active June 8, 2023 01:38
Scroll to Top with auto hide
// hide the topbutton on page load/ready.
jQuery('.scrolltop-btn').hide();
//Check to see if the window is top if not then display button
jQuery(window).scroll(function(){
if (jQuery(this).scrollTop() > 100) {
jQuery('.scrolltop-btn').show().fadeIn();
} else {
jQuery('.scrolltop-btn').fadeOut().hide();