Skip to content

Instantly share code, notes, and snippets.

@neutmute
neutmute / dimmer.rules
Last active March 6, 2021 17:12
openhab universal dimmer
import org.openhab.core.model.script.ScriptServiceUtil
/*
# UniversalDimmer for OpenHAB 3
Reliably dim or colour lights or change volume of a target value over a set period of time
Thread: https://community.openhab.org/t/rule-to-slowly-fading-in-or-out-any-given-item-based-on-variables/54988/30?u=habau
Source: https://gist.github.com/neutmute/6a8e44f300b2b5a4971630371cd0dd97
Requires the RegEx transformation to be installed
*/
@neutmute
neutmute / generate_dto.sql
Last active October 31, 2016 02:55 — forked from evgeny-myasishchev/generate_dto.sql
TSQL script to generate POCO/DTO from database table
DECLARE @tableName NVARCHAR(MAX), @schemaName NVARCHAR(MAX), @className NVARCHAR(MAX)
--------------- Input arguments ---------------
SET @tableName = 'CustomerView'
SET @schemaName = 'dbo'
SET @className = 'CustomerDto'
--------------- Input arguments end -----------
DECLARE tableColumns CURSOR LOCAL FOR
SELECT cols.name, cols.system_type_id, cols.is_nullable FROM sys.columns cols
@neutmute
neutmute / gist:9147687
Created February 22, 2014 02:23
Console2 Context Menu
Windows Registry Editor Version 5.00
;Encoding should be UCS little endian
[-HKEY_CLASSES_ROOT\Directory\shell\console2here]
[HKEY_CLASSES_ROOT\Directory\shell\console2here]
@="Open console here"
"Icon"="C:\\apps\\console2\\vscommand.ico"
[-HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
[HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
@="\"C:\\apps\\console2\\Console.exe\" -d \"%L\""
# git bash using console2
@neutmute
neutmute / statsd.conf
Created June 5, 2012 05:44
upstart to start statsd
description "statsd"
start on startup
stop on shutdown
script
export HOME="/root"
cd /opt/statsd && node ./stats.js ./localConfig.js
end script
@neutmute
neutmute / statsd.sh
Created June 5, 2012 05:42
install statsd.h
#!/bin/bash
#Based off https://gist.github.com/2854114
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm