Skip to content

Instantly share code, notes, and snippets.

@gyengus
gyengus / lego_holder_light.yaml
Created April 18, 2020 16:24
Esphome config
esphome:
name: lego_holder_light
platform: ESP8266
board: nodemcuv2
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_passwd
fast_connect: true
power_save_mode: none
@gyengus
gyengus / .gitlab-ci.yml
Created December 9, 2018 15:49
Gitlab CI config for Home Assistant
stages:
- test
- deploy
- notify
test:
stage: test
image: homeassistant/amd64-homeassistant:0.83.3
before_script:
- hass --version
1,2c1
< dist: trusty
< sudo: required
---
> image: debian
4c3,4
< language: c++
---
> stages:
> - build
<?php
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$scheme = "https";
$_SERVER['HTTPS'] = 'on';
} else {
$scheme = "http";
}
define('WP_SITEURL', $scheme . '://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', $scheme . '://' . $_SERVER['HTTP_HOST']);
<ifmodule mod_ssl.c>
<virtualhost *:443>
ServerName gyengus.hu
ServerAlias www.gyengus.hu
RequestHeader set X-Forwarded-Proto "https"
ProxyPreserveHost on
ProxyPass / http://localhost:8888/
ProxyPassReverse / http://localhost:8888/
version: "2"
services:
wordpress:
build: .
#image: ulsmith/alpine-apache-php7
volumes:
- ./www:/app/public
- ./logs:/var/log
environment:
@gyengus
gyengus / redbear_duo_blink.ino
Created March 6, 2016 12:53
redbear_duo_blink.ino
@gyengus
gyengus / pushbullet_gw.php
Created July 25, 2015 07:22
Pushbullet gateway
<?php
$title = "";
if (isset($_POST['title'])) $title = $_POST['title'];
$text = "";
if (isset($_POST['text'])) $text = $_POST['text'];
$dest = "";
if (isset($_POST['dest'])) $dest = $_POST['dest'];
if ($title and $text) {
$url = "https://api.pushbullet.com/v2/pushes";
@gyengus
gyengus / thermometer_demo.ino
Created July 24, 2015 19:30
Particle Photon thermometer demo
#include "OneWire.h"
OneWire ds(D3);
void btn_handler(void);
int readTemp(String command);
void pushbulletTemp(void);
uint8_t gateway_ip[] = {192, 168, 0, 11};
int gateway_port = 80;
@gyengus
gyengus / espruino_bmp180.js
Last active August 29, 2015 14:23
Espruino Pico BMP180 example
I2C1.setup({scl: B6, sda: B7});
var bmp = require("BMP085").connect(I2C1, 3);
function readBTN() {
if (digitalRead(BTN1) == 1) {
LED1.write(true);
bmp.getPressure(function(d) {
console.log(new Date().toString());
console.log("Pressure: " + d.pressure + " Pa");
console.log("Temperature: " + d.temperature + " °C");