Skip to content

Instantly share code, notes, and snippets.

@hurricanepkt
hurricanepkt / WriteMYCodeForMe.cs
Created April 2, 2024 05:13
A bit of code that takes data from a CSV and puts seed data to the console
// See https://aka.ms/new-console-template for more information
using System.Formats.Asn1;
using System.Globalization;
using System;
using CsvHelper;
using System.ComponentModel.DataAnnotations;
using System.Net.Mail;
using System.Text;
Console.WriteLine("Hello, World!");
@hurricanepkt
hurricanepkt / z2m_button_light_control.yaml
Last active March 10, 2022 05:40
Zigbee2Mqtt Button Light Control
blueprint:
name: Zigbee2MQTT Button Control
description: "This Blueprint allows Zigbee2MQTT - Sonoff SNZB01 button to lights. Different Lights for Single, double, and Long Press"
domain: automation
input:
z2m_button_topic:
name: MQTT State Topic of your Zigbee2MQTT Button
description: "The State Topic is composed of your Zigbee2MQTT base_topic (see your Z2M Addon Configuration) and the Friendly Name of your keypad in Z2M. Example: zigbee2mqtt/0x00124b0024ce317c"
single_light:
name: Single Press Light
@hurricanepkt
hurricanepkt / error_logs.txt
Last active January 8, 2022 18:28
Blerry Logs
19:28:04.298 WIF: Checking connection...
19:28:06.757 MQT: tele/esp_mini32_blerry_04/BLE = {"DetailsBLE":{"mac":"A4C138F07A87","a":"ble_cli_bathroom","RSSI":-79,"p":"10161A18A4C138F07A8700F9592109EAC6","0x181a":"A4C138F07A8700F9592109EAC6"}}
19:28:06.788 BRY: GC from 19237 to 15962 bytes, objects freed 63/250 (in 3 ms)
19:28:08.109 MQT: tele/esp_mini32_blerry_04/BLE = {"DetailsBLE":{"mac":"A4C138A424BF","a":"ble_cli_office","RSSI":-67,"p":"10161A18A4C138A424BF00EE42520B8262","0x181a":"A4C138A424BF00EE42520B8262"}}
19:28:08.140 BRY: GC from 18354 to 15960 bytes, objects freed 41/250 (in 3 ms)
19:28:13.771 MQT: tele/esp_mini32_blerry_04/BLE = {"DetailsBLE":{"mac":"A4C138A424BF","a":"ble_cli_office","RSSI":-64,"p":"10161A18A4C138A424BF00EE42520B8262","0x181a":"A4C138A424BF00EE42520B8262"}}
19:28:13.803 BRY: GC from 20479 to 15960 bytes, objects freed 96/250 (in 4 ms)
19:28:14.175 MQT: tele/esp_mini32_blerry_04/BLE = {"DetailsBLE":{"mac":"A4C138747164","a":"ble_cli_porch","RSSI":-81,"p":"10161A18A4C13874716400F44
@hurricanepkt
hurricanepkt / gist:b54ecc448709a22f4b54ec288b98713d
Last active May 8, 2020 18:00
Pronterface Calibration break
>>> M502
SENDING:M502
ok P63 B7
>>> G33
SENDING:G33
G33 Auto Calibrate
Checking... AC
.Height:130.00 Ex:+0.00 Ey:+0.00 Ez:+0.00 Radius:63.35
. Tx:+0.00 Ty:+0.00 Tz:+0.00
echo:busy: processing
@hurricanepkt
hurricanepkt / keybase.md
Created August 2, 2019 18:52
keybase.md

Keybase proof

I hereby claim:

  • I am hurricanepkt on github.
  • I am markgreenway (https://keybase.io/markgreenway) on keybase.
  • I have a public key whose fingerprint is 62F5 2C1E BFEE BEB8 0F22 7C32 17F5 24E3 A520 E2B7

To claim this, I am signing this object:

@hurricanepkt
hurricanepkt / LocalOverrides.txt
Last active October 25, 2018 00:24
LocalOverrides.txt
10.10.1.1 bad.36min.uk
10.10.1.1 fakeoutarhelkjhwer.com
@hurricanepkt
hurricanepkt / HelperClass.cs
Created July 15, 2015 21:36
HowToSetup Mapping
public class HelperClass // Rename me
{
private Dictionary<string,tbl_Policy> PolicyCache = new Dictionary<string,tbl_Policy>();
private Dictionary<string,tbl_Client> ClientCache = new Dictionary<string,tbl_Client>();
public tbl_Policy FindPolicyFromPolicyNumber(string policyNumber)
{
if (PolicyCache.ContainsKey(policyNumber)) {
return PolicyCache[policyNumber];
}
var pol = ctx.tbl_Policy.Include("tbl_Client").Single(f => f.txt_policyNumber == policyNumber);
@hurricanepkt
hurricanepkt / EvilPattern.asp
Created February 25, 2015 20:28
Look at the evil I Once Performed
sql = "SELECT aut_id FROM tbl_quote ORDER BY aut_id"
Session("SQL") = SQL
Session("SQLTime") = Now
Call RecordsetOpen(sql)
RS.Movelast
autID = RS("aut_id")
call RecordsetClose()
@hurricanepkt
hurricanepkt / Demo.cs
Last active August 29, 2015 14:13
Saving Code
Expression<Func<string,string>> upperer = lower => lower.ToUpper();
Console.WriteLine(upperer.ToString());
@hurricanepkt
hurricanepkt / Enum.cs
Created December 8, 2014 20:59
Persisting calculations
public ActionResult Index()
{
var f = new ScrapData {Linqed = Linqed.Invert};
var col = MongoStuff.GetCollectionSafe<ScrapData>("Scraps");
col.Save(f);
return Content(JsonConvert.SerializeObject(f), "application/json");
}
public ActionResult Foo()
{