Skip to content

Instantly share code, notes, and snippets.

@theosnel
theosnel / wled tree mapper.py
Created December 11, 2023 19:19
wled christmas tree map generator
import json
from collections import defaultdict
matrix = defaultdict(list)
width = 30
# each row in the tree, from top to bottom.
# [first led, middle led, last led], counting from 0
input = [
@OFark
OFark / Unraid Balancer.linq
Created January 1, 2023 12:13
Balances Unraid drives
<Query Kind="Program">
<NuGetReference>ByteSize</NuGetReference>
<Namespace>ByteSizeLib</Namespace>
<Namespace>System.Diagnostics.CodeAnalysis</Namespace>
<Namespace>System.Runtime.InteropServices</Namespace>
<Namespace>System.Security</Namespace>
<Namespace>System.Text.Json</Namespace>
</Query>
string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "unraidMap.Json");
@SgtBatten
SgtBatten / frigate_0.11_notification.yaml
Last active December 7, 2023 20:09 — forked from hunterjm/frigate_0.10_notification.yaml
Frigate Notifications have moved
blueprint:
name: Frigate Notifications by SgtB have moved
description: |
## ANNOUNCEMENT
I have moved from this gist to a github repositry.
Please checkout https://github.com/SgtBatten/HA_blueprints for the latest versions
domain: automation
@ChipCE
ChipCE / readme.md
Last active May 2, 2024 08:38
Klipper bed mesh on print area only macro install guide

READ THIS FIRST

Adaptive bed mesh is merged into klipper master branch. You can use this feature without this custom macro. Official klipper adaptive bed mesh

Klipper mesh on print area only install guide

What this macro do

  • This macro will dynamically changing the bed mesh area based on the size of the parts will be printed. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)
@Minionguyjpro
Minionguyjpro / Activate_Windows_8_8.1_10_and_11_Pro_for_Free.md
Last active May 21, 2024 14:44
Activate Windows 8, 8.1, 10 and 11 Pro for Free

Activate Windows 8, 8.1, 10 and 11 Pro for Free

A guide how to get and activate Windows 8, 8.1, 10 and 11 Pro for free!

NOTE

If you see the Windows keyboard button in this guide; and you can't find it on your keyboard, you likely have/had Windows 10 which has the button . If you can't find that one, you likely have a PC that has been upgraded to Windows 8/8.1/10/11 from Windows 8.1/8/7/Vista/XP and other ones. If you have one of those, refer the Windows key button to as yours. A list of them is below:

Windows key buttons

- Windows 11

- Windows 10

@marcelaraujo
marcelaraujo / README.md
Last active October 14, 2023 18:17
Convert P12 to PEM and extract RSA public and private keys

Convert P12 into PEM

openssl pkcs12 -in google-service-account-key.p12 -nocerts -nodes -out google-service-account-key.pem

openssl pkcs12 -in google-service-account-key.p12 -clcerts -nokeys -out google-service-account-crt.pem

Private RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa

Public RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa.pub -pubout

@mlocati
mlocati / color-scale.js
Last active May 1, 2024 10:55
Javascript color scale from 0% to 100%, rendering it from red to yellow to green
// License: MIT - https://opensource.org/licenses/MIT
// Author: Michele Locati <michele@locati.it>
// Source: https://gist.github.com/mlocati/7210513
function perc2color(perc) {
var r, g, b = 0;
if(perc < 50) {
r = 255;
g = Math.round(5.1 * perc);
}
else {