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 / 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 / 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