Skip to content

Instantly share code, notes, and snippets.

View fosron's full-sized avatar
💻
Hard at work

Tautvydas fosron

💻
Hard at work
View GitHub Profile
@fosron
fosron / configuration.yaml
Last active March 5, 2025 13:20
Komfovent C8 Home Assistant Modbus basic integration
### Add this to your configuration.yaml
### Make sure to adjust the host IP address
modbus:
- type: tcp
host: 192.168.50.91
port: 502
name: komfovent
switches:
- name: "Komfovent Power"
@fosron
fosron / heating.yaml
Last active February 26, 2025 09:26 — forked from r3mcos3/heating.yaml
Home Assistant Blueprint For Heating
blueprint:
name: Heating Control (Basic Switch with Hysteresis & Global Heating Season)
description: >
Control your heating switch based on a lower and an upper temperature threshold,
a time window, and a global heating season condition. When the heating season is off,
the heating will be forced off across all zones.
domain: automation
input:
heating:
name: Heating Switch
@fosron
fosron / filter-wp-request.php
Created February 26, 2025 09:15 — forked from Shelob9/filter-wp-request.php
Using pre_http_request filter to mock HTTP request responses in WordPress phpunit test https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-http.php#L240-L262
<?php
class Test extends TestCase {
public function test_function_that_makes_api_request(){
add_filter('pre_http_request', function(){
return [
'body' => [
'id' => 1,
],
@fosron
fosron / eafcpacks.js
Created January 23, 2024 14:10
get all packs in chrome dev tools
// Create an object to hold the titles and their counts
let titleCounts = {};
// Select all elements with the class 'ut-store-pack-details-view'
let packs = document.querySelectorAll('.ut-store-pack-details-view');
// Iterate over the NodeList
packs.forEach((pack) => {
// Determine if the pack is tradeable or untradeable
let tradeStatus = pack.classList.contains('is-tradeable') ? 'Tradeable' : 'Untradeable';
@fosron
fosron / stream_deck_monitor.md
Created May 5, 2023 09:19
Stream Deck MK2 Monitor

To create an auto-run macOS service that monitors the connection of your Stream Deck MK.2 and runs the Stream Deck app when the device is connected, you can use a launchd user agent. Here's how to set it up:

  1. Create a new script monitor_stream_deck.sh in your home directory:
nano ~/monitor_stream_deck.sh
  1. Paste the following script into the file:
@fosron
fosron / streamdeck_monitor.sh
Last active May 5, 2023 08:51
streamdeck_monitor.sh
#!/bin/bash
# Replace this with the correct path to the Stream Deck app
STREAMDECK_APP_PATH="/Applications/Stream Deck.app"
# Vendor and product ID for Stream Deck (Elgato Stream Deck MK2)
VENDOR_ID="0fd9"
PRODUCT_ID="0080"
# Function to check if the Stream Deck is connected
@fosron
fosron / killrunningboardd.sh
Last active January 18, 2022 16:43
killrunningboardd.sh
#!/bin/bash
while true;
do
for pid in $(ps -ef | awk '/runningboardd/ {print $2}'); do pkill -9 $pid; done
sleep 10
done
<?php
class MailsterMailerSend {
private $plugin_path;
private $plugin_url;
/**
*
*/
dietpi@DietPi:/etc/modprobe.d$ sudo dietpi-config
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 0 with SSID "Tautwifi 5GHz"
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 1 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 2 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 3 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 4 with SSID ""
[ SUB1 ] DietPi-Services > stop
[ OK ] DietPi-Services | stop : cron
[ OK ] DietPi-Services | stop : docker
[ OK ] DietPi-Services | stop : rpimonitor
@fosron
fosron / .php_cs.laravel.php
Created April 14, 2020 09:34 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]