Skip to content

Instantly share code, notes, and snippets.

View AndreTeixeira1998's full-sized avatar
🎯
Focusing

André_Teixeira_1998 AndreTeixeira1998

🎯
Focusing
View GitHub Profile
@AndreTeixeira1998
AndreTeixeira1998 / GenericMakefile.mk
Created August 11, 2023 22:43 — forked from natanaeljr/GenericMakefile.mk
Simple generic makefile example to start a project quickly. Can: select C or C++ compiler automatically, identify multiple extentions, detect auto-dependencies and compile modified files only, etc. Various modifiable settings.
PROJECT := $(notdir $(CURDIR))
EXCECUTABLE = $(BUILDDIR)/$(PROJECT)
# Directories specification
SRCDIRS := src
INCDIRS := include
BUILDDIR := build
# @note: to add another source extension, add to herer AND make sure to
# write the " $(BUILDDIR)/%.o: %.ext " rule for this extention in order to work
@AndreTeixeira1998
AndreTeixeira1998 / README.md
Created March 6, 2023 23:11 — forked from ReSTARTR/README.md
ZeroMQ sample in Go and Python. (with MonitoredQueue)

Versions

  • zeromq: stable 3.2.2
  • go: 1.0.3
    • gozmq: zmq_3_x
  • python: 2.7.3
    • pyzmq: 13.0.2

Usage

//-----------------------Intro - most important:
// wp-content/themes/evolve/functions.php
function funkyMonky() {
// Handle request then generate response using echo or leaving PHP and using HTML
echo "hi";
}
add_action('admin_post_takeaway_settings_order','funkyMonky');
@AndreTeixeira1998
AndreTeixeira1998 / presence_non_binary.yaml
Created July 13, 2022 08:41 — forked from cliffordwhansen/presence_non_binary.yaml
Making Home Assistant’s Presence Detection not so Binary
blueprint:
name: "Person: Status Update"
description: Making Home Assistant’s Presence Detection not so Binary
domain: automation
input:
person_device_tracker:
name: Device tracker
description: This is the device tracker for the person
selector:
entity:
@AndreTeixeira1998
AndreTeixeira1998 / buildAllProduction.sh
Created July 1, 2022 00:54 — forked from theGeekPirate/buildAllProduction.sh
Builds a Go production (debug info stripped) binary for all supported platforms (excluding mobile)
#!/bin/sh
#From https://golang.org/doc/install/source#environment
platforms=(aix android darwin dragonfly freebsd illumos js linux netbsd openbsd plan9 solaris windows)
arches=(386 amd64 arm arm64 mips mipsle mips64 mips64le ppc64 ppc64le s390x wasm)
#.go file to build
test "$1" && target="$1"
if ! test "$target"; then
@AndreTeixeira1998
AndreTeixeira1998 / Shelly.2.5.configuration.md
Created June 8, 2022 11:53 — forked from markuspeter/Shelly.2.5.configuration.md
Flash and configure Shelly 2.5 for roller/shutter

Shelly 2.5 Tasmota configuration

Use Shelly 2.5 for existing roller/blinds with up/down button switches and a second shutter for the tilt angle.

Tasmota build

  • Activate shutter and blinds (info)
  • Deactivate some modules (Domoticz etc.)
@AndreTeixeira1998
AndreTeixeira1998 / gpio.java
Created June 6, 2022 23:57 — forked from rosterloh/gpio.java
Android class for GPIO control
public class GPIO {
public String port;
public int pin;
//get direction of gpio
public String getInOut()
{
String command = String.format("cat /sys/class/gpio/%s/direction",this.port);
try {
@AndreTeixeira1998
AndreTeixeira1998 / configuration.yaml
Created May 26, 2022 17:43 — forked from josalbuquerque/configuration.yaml
Relay SR-201 - Integration Home Assistant
switch 1:
platform: telnet
switches:
garage_door:
resource: "192.168.1.100"
port: 6722
command_on: '11*'
command_off: '21:0^'
command_state: '00:0^'
value_template: '{{ value == "10000000" or value == "11000000" }}'
exten => _X.,1,Set(CURL_RESULT=${CURL(http://domain.com/test.txt)})
same => n,GotoIf($["${CURL_RESULT}" = "1"]?result1:result2)
same => n(result1),Verbose(Result 1)
same => n,Hangup
same => n(result2),Verbose(Result other)
same => n,Hangup
@AndreTeixeira1998
AndreTeixeira1998 / serve.go
Created February 5, 2022 23:57 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main