Skip to content

Instantly share code, notes, and snippets.

View unwiredtech's full-sized avatar

Patrick Sarmiento unwiredtech

View GitHub Profile
<?php
/*
• A fully hierarchical, cascading search form
• AJAX populates States based on selected Workspace Type
• Then populates Cities based on selected State + Type
• Searches and returns locations filtered by all 3 levels
*/
function workspace_search_form_shortcode() {
ob_start();
@unwiredtech
unwiredtech / grid-listing-pagination-reposition.js
Last active February 12, 2025 15:21
Grid Listing - Pagination Reposition
<script>
document.addEventListener("DOMContentLoaded", function () {
function repositionSlickDots() {
const grid = document.querySelector("#what-we-do");
const dots = document.querySelector(".jet-slick-dots");
const draggable = document.querySelector(".slick-list.draggable");
if (grid && dots && draggable) {
// Detach .jet-slick-dots from its parent
const parent = dots.parentNode;
@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