Skip to content

Instantly share code, notes, and snippets.

View kbosilkov's full-sized avatar

Krasimir Bosilkov kbosilkov

View GitHub Profile
service: media_player.play_media
target:
device_id: b9e3064654ed6eb45dd434c508d656a3
data:
media_content_type: "audio/mp3"
media_content_id: "media-source://media_source/local/filename.mp3"
@janeczku
janeczku / gosund_sp1.yaml
Last active March 21, 2023 09:44
Gosund SP1 + Esphome
substitutions:
devicename: gosund_sp1_01
friendlyname: SP1 Socket 01
sp1_current_resistor: "0.00221"
sp1_voltage_divider: "871"
#############
# Note: These numbers were found online
# BW SHP2 Current Resistor: 0.0028
# BW SHP2 Voltage Devider: 960
# Gosund SP1 Current Resistor: 0.00221
@zvldz
zvldz / soft_hack.md
Last active March 20, 2025 16:04
soft_hack.md

Soft hack to open telnet

You need gateway 3(mgl03) connected to MiHome. And also ip and gateway token.

1 way (recommended)

Via XiaomiGateway3 component.

You must input in the 'Open Telnet command' field(as it is without changing anything):

{"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}
@dimitarminchev
dimitarminchev / borica_request.php
Last active October 30, 2024 04:46
Borica Request 4.0
<?php
/*
# Borica Request 4.0
Изпращане на заявка за извършване на електронно плащане: [borica_request.php](https://gist.github.com/dimitarminchev/08d8ab833fa481a8cc5c1e365a16c05e)
- Документация: [Borica APGW e-Gateway Resources](https://3dsgate-dev.borica.bg/)
- Автор: [доц. д-р Димитър Минчев](http://www.minchev.eu)
- Eлектронна поща: [[email protected]](mailto:[email protected])
*/
// Gateway
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active December 18, 2024 08:43 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@bertrandmartel
bertrandmartel / aggregation_lookup.md
Last active December 22, 2023 13:32
MongoDB $lookup aggregation example

MongoDB $lookup aggregation

SO link

db.votes.aggregate([{
    $lookup: {
        from: "users",
        localField: "createdBy",
        foreignField: "_id",
<?php
/**
* Created by PhpStorm.
* User: lucius
* Date: 19.10.16
* Time: 16:49
*/
namespace Concrete\Package\BasicTablePackage\Src\DiscriminatorEntry;
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active May 21, 2024 03:39
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.