Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: ZHA - Philips Hue Dimmer Switch Config - V2023.12.15
description: |
Control lights with a Philips Hue Dimmer Switch (only RWL020 (US) and RWL021 (EU), RWL022, the one that says 'hue' on the bottom, has a different button layout.)
This blueprint is a simplified version of stefanroelofs's `ZHA - Philis Hue Dimmer Switch V2', but this one has no default inputs and with full configuration available. This makes the remote easily configurable for purposes other than controlling lights.
If you are intending to just use it for use as a light switch, I recommend using his blueprint, which you can find at https://gist.github.com/stefanroelofs/775e2e0a3cdb3d72a9451fb247492d59
It includes customizable 'on' button behaviour and default setup of the dimmer buttons to dim as they normally would. To make the configuration available for other automations, I had to remove these very useful functionalities.
@buxtonpaul
buxtonpaul / wsldisplay.py
Created May 14, 2020 15:10
Quick'n'dirty python script to create the display variable for use with WSL2
#!/usr/bin/python3
import os
for line in os.popen('ipconfig.exe'):
if not line[0] in [' ', '\n']:
current_section = line
active = False
if 'Link-local IPv6 Address' in line:
active = True
@Indigo744
Indigo744 / ProcessAsyncHelper.cs
Last active July 26, 2023 10:09 — forked from georg-jung/ProcessAsyncHelper.cs
The right way to run external process in .NET (async version)
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// Process helper with asynchronous interface
/// - Based on https://gist.github.com/georg-jung/3a8703946075d56423e418ea76212745
/// - And on https://stackoverflow.com/questions/470256/process-waitforexit-asynchronously
/// </summary>
@jnm2
jnm2 / JosephPersonalDesktopBoxstarter.ps1
Last active July 28, 2022 11:17
Joseph personal desktop Boxstarter script
# TODO: Set sound scheme to 'No sounds'
# Notepad++ TODOs:
# %appdata%\Notepad++\config.xml, /NotepadPlus/GUIConfigs/GUIConfig[name='TabSetting']/@replaceBySpace, 'yes'
# %appdata%\Notepad++\config.xml, /NotepadPlus/GUIConfigs/GUIConfig[name='auto-completion']/@autoCAction, 0
# %appdata%\Notepad++\stylers.xml, /NotepadPlus/GlobalStyles/WidgetStyle[fontName='Courier New']/@fontName, 'Consolas'
# TODO: unpin Edge and Store and pin default apps
$ErrorActionPreference = 'Stop'
@mackwage
mackwage / windows_hardening.cmd
Last active April 28, 2024 20:54
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@NickCraver
NickCraver / SSMS17and17-HiDPI.ps1
Last active June 24, 2023 23:30
PowerShell: SSMS 16 & 17 HiDPI Enable
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"><asmv3:application><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>True</dpiAware></asmv3:windowsSettings></asmv3:application><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type="win32" name="debuggerproxy.dll" processorArchitecture="X86" version="1.0.0.0"></assemblyIdentity></dependentAssembly></dependency></assembly>';
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide" -Name PreferExternalManifest -Value 1 -Type DWord;
$ssms16 = "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe";
if ((
@NickCraver
NickCraver / Svg.cs
Created February 1, 2017 22:36
A simple SVG helper for Stack Overflow that inlines SVGs into Razor views efficiently
using System;
using System.IO;
using System.Web;
using System.Web.Hosting;
namespace StackOverflow.Helpers
{
public static class Svg
{
// NOTE: To add a new SVG icon, copy paste the line below. Paste it after the other ones.
@eladmarg
eladmarg / GenericLRUCache.cs
Created September 28, 2016 20:28
LRUCache C# Implementation
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Utils
{
public class GenericLRUCache<TV, TU> where TU : class
{
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@davidfowl
davidfowl / dotnetlayout.md
Last active May 15, 2024 07:06
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/