Skip to content

Instantly share code, notes, and snippets.

@wontoncc
wontoncc / balloontip.py
Last active November 18, 2024 01:04
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip:
@blacktm
blacktm / install_ruby_rpi.sh
Last active November 28, 2024 20:35
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@darkyen
darkyen / gist:120c46739985ebf3b39b
Created June 10, 2015 03:40
Ferengi Rules of Acquisition [Complete List*]
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode)
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel)
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode)
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel)
5 "Always exaggerate your estimates." Cold Fusion (SCE novel)
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode)
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode)
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel)
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode)
10 "Greed is eternal." "Prophet Motive" (VOY episode)
@kost
kost / esp8266-wifi-beacon-generator.ino
Created April 16, 2016 15:14
ESP8266 WiFi Beacon Generator - Generate SSID beacon frames on ESP8226
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
byte channel;
int maxssids=10; /* how much SSIDs we have */
char *ssids[] = {
@mnadeem
mnadeem / pom.xml
Created July 15, 2017 16:02
Add non maven jar in maven way
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.demo.app</groupId>
<artifactId>demo-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<version.maven-install-plugin>2.5.2</version.maven-install-plugin>
<version.non-maven1>1.0.0</version.non-maven1>
@0xFelix
0xFelix / codes.txt
Last active July 15, 2019 10:47
Sonoff RF Bridge 433 / ESPurna and Brennenstuhl RCS 1000 N
Sonoff RF Bridge 433 / ESPurna and Brennenstuhl RCS 1000 N
Taken from
http://tinkerman.cat/decoding-433mhz-rf-data-from-wireless-switches-the-data
and
https://www.itead.cc/wiki/images/5/5e/RF_Universal_Transeceive_Module_Serial_Protocol_v1.0.pdf
and
https://github.com/pimatic/rfcontroljs/blob/master/src/protocols/switch2.coffee
Protocol 'switch2' (Elro)
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active October 23, 2024 13:02
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@me-no-dev
me-no-dev / IP5306.ino
Last active September 4, 2023 08:22
Sketch with IP5306 integration
#include "Arduino.h"
#include "Wire.h"
/*
** IP5306 Power Module
*/
/* M5 Defaults
KeyOff: Enabled
BoostOutput: Disabled
esphome:
name: plant_moisture
platform: ESP32
board: esp32dev
wifi:
ssid: "spam"
password: "eggs"
# Enable logging
@markusressel
markusressel / esphome_neopixel_clock_effect.yaml
Last active December 23, 2024 12:26
ESPHome configuration example to create an animated clock using the Neopixel 60 LED ring
Moved to https://github.com/markusressel/ESPHome-Analog-Clock