Skip to content

Instantly share code, notes, and snippets.

View unwiredtech's full-sized avatar

Patrick Sarmiento unwiredtech

View GitHub Profile
@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) : '';
//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 / 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
@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 / 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 / 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;
<?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 / listing-grid-slider-fluid-right.html
Created August 19, 2025 11:03
Fluid-Right Elementor Wrapper for JetEngine / Slick Sliders This snippet creates a full-width band that stretches with the viewport (e.g. 1920px) but keeps its right edge aligned with Elementor’s content box width. It’s useful for carousels, sliders, or listing grids where you want content to “bleed” left but still snap to Elementor’s grid on th…
/*Fluid-Right Elementor Wrapper for JetEngine / Slick Sliders
This snippet creates a full-width band that stretches with the viewport (e.g. 1920px) but keeps its right edge aligned with Elementor’s content box width.
It’s useful for carousels, sliders, or listing grids where you want content to “bleed” left but still snap to Elementor’s grid on the right side.
Use Case
• Showcase sliders (JetEngine, Slick, Elementor widgets) that need to look full-bleed while respecting Elementor’s content alignment.
• Aligns the right edge with Elementor’s boxed content while allowing the left edge to expand (fluid-right).
• Keeps navigation dots and arrows centered neatly under the cards.
*/
@unwiredtech
unwiredtech / listing-grid-slider-dot-and-button.js
Created August 19, 2025 11:17
Move Listing Grid Dots and Custom Nxt/Prv Button for Slider
<script>
/**
* JetEngine/Slick: Move dots into #listing-dot-nav
*/
(function () {
'use strict';
if (typeof window.jQuery === 'undefined') return;
var $ = window.jQuery;
var DOTS = 'ul.jet-slick-dots';
<form name="post" action="post.php" method="post" id="post">
<input type="hidden" id="_wpnonce" name="_wpnonce" value="354e283bb2"><input type="hidden" name="_wp_http_referer" value="/wp-admin/post.php?post=87532&amp;action=edit"><input type="hidden" id="user-id" name="user_ID" value="3">
<input type="hidden" id="hiddenaction" name="action" value="editpost">
<input type="hidden" id="originalaction" name="originalaction" value="editpost">
<input type="hidden" id="post_author" name="post_author" value="3">
<input type="hidden" id="post_type" name="post_type" value="mapplic_map">
<input type="hidden" id="original_post_status" name="original_post_status" value="publish">
<input type="hidden" id="referredby" name="referredby" value="https://staging39.jbrec.com/wp-admin/edit.php?post_type=mapplic_map">
<input type="hidden" id="active_post_lock" value="1756219075:3">
<input type="hidden" name="_wp_original_http_referer" value="https://staging39.jbrec.com/wp-admin/edit.php?post_type=mapplic_map"><input type="hidden"