Skip to content

Instantly share code, notes, and snippets.

View poblabs's full-sized avatar

Pat poblabs

  • Western MA, USA
View GitHub Profile
@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active August 22, 2024 18:14
Setting up Emporia Vue 2 with ESPHome
@todbot
todbot / circuitpyton_disable_usb_boot.py
Last active August 27, 2023 10:11
Disable USB devices in CircuitPython in boot.py
# circuitpython_disable_usb_boot.py
# Turn on/off certain USB features based on touching RX & TX pins
# Squeeze TX & RX pins with fingers to enable CIRCUITPY & REPL
# Otherwise, they are turned off
# CircuitPython 7.x only
# Rename this as "boot.py" in your CIRCUITPY drive on a QT PY
# @todbot 17 May 2021
import time
import board
@rystaf
rystaf / gotify.ps1
Last active December 7, 2021 08:58
Gotify notifications for Windows 10 using BurntToast https://github.com/Windos/BurntToast
param ($domain="p.domain.com", $token="AAAAAAAA")
wscat -c "wss://$domain/stream?token=$token" | %{ convertfrom-json $_ } | where-object {$_.message.length -gt 0} |
%{
$appid = $_.appid
$icon = iwr https://$domain/application?token=$token |
%{ (convertfrom-json $_.content) } | where-object {$_.id -eq $appid} | select -expandproperty image
new-burnttoastnotification -applogo https://$domain/$icon -Text $_.title, $_.message
}
@frenck
frenck / hassio_ubuntu_install_commands.sh
Last active February 1, 2023 05:38
Simple install command for installing Hass.io on a Generic Ubuntu/Debian machine
Unbuntu is no longer support by the Home Assistant project.
The installation commands previous listed here, are not up 2 date, not recommended, not supported and, therefore, removed.
@nickcernis
nickcernis / functions.php
Last active May 26, 2018 19:18
Add a login/logout link to the menu bar of any Genesis child theme
<?php // add everything except for this opening line to your functions file
add_filter( 'wp_nav_menu_items', 'sp_add_loginout_link', 10, 2 );
function sp_add_loginout_link( $items, $args ) {
// Change 'primary' to 'secondary' to put the login link in your secondary nav bar.
if ( $args->theme_location != 'primary' ) {
return $items;
}
@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung