Skip to content

Instantly share code, notes, and snippets.

View ssshake's full-sized avatar

Richard Bettridge ssshake

View GitHub Profile
blueprint:
name: Philips Hue Dimmer Switch Custom ssshake
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.
@ssshake
ssshake / NPCDialog.cs
Last active March 4, 2024 17:39
Unity NPC Dialog with Branching Nodes and Unlimited Statements and Responses
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace Daggasoft {
[System.Serializable]
public class Statement {
# Position relative to HMD
OVRCameraRig rig;
rig = FindObjectOfType<OVRCameraRig>();
transform.position = rig.transform.TransformPoint(menuOffset);
Vector3 newEulerRot = rig.transform.rotation.eulerAngles;
newEulerRot.x = 0.0f;
newEulerRot.z = 0.0f;
transform.eulerAngles = newEulerRot;
//Adding this here because I couldn't figure out how to tell my grabble items in a game world when it's been grabbed
//so that it could do something on grab or release. Such as play a sound effect.
//
//After a lot of document searching I was surprised that I couldn't find what I was looking for.
//
//This extends OVRGrabble from the Oculus Unity SDK.
//You override methods called on grab
//You do your custom work
//You then pass the attributes on to OVRGrabble because it still needs these to do its own piece of work
//So, it's a pain in the ass to use scrollTo within an iframe because
//the parent document and the document in the iframe have no context of each other.
//
//The problem can be hard to imagine if you haven't directly ran into it before, but lets assume you have
//a parent document that is a couple thousand pixels high. It spans off the screen.
//In that document you have an iframe somewhere near the top (or wherever)
//Under some condition you want to scroll to the top (or anywhere) of the iframe
//But lets say in the parent document you a scrolled all the way to the bottom so the iframe isn't in view at all
//When you issue window.scrollTo(0,0), the iframe itself will scroll to the top, but the parent document wont do anything.
//Why would it? It has no context.
@ssshake
ssshake / isWrit
Last active June 21, 2026 02:27
Photon PUN Cheat Sheet
## Photon Methods
**public class Blank : Photon.PunBehaviour**
instead of mono behavior, use this to receive photon callbacks in your script.
**public override void OnLeftRoom()**
An example of overriding a punbehavior callback
@ssshake
ssshake / YouveGotMail.ino
Last active December 24, 2017 03:01
Youve Got Mail - Home Mailbox Notifier using ESP12E
/**
* YouveGotMail.ino
* Check your home mailbox for new mail and notify some service
* Created by https://github.com/ssshake
*
*/
#include <Arduino.h>
#include <ESP8266WiFi.h>
;Install autohotkey https://www.autohotkey.com/download/
;put this in your startup folder
;enjoy
;maps common osx keys.
;ctrl + z,x,c,v,a,s,y are all accessible via winkey + z,x,c,v,a,s,y
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
@ssshake
ssshake / screeshot-resize-for-app-store.sh
Created November 1, 2017 18:21
Take in screenshots and resize them to meet the requirements for iphone and ipad dimensions in the app store
mkdir iphone
mkdir ipad
cp *.jpg iphone/
cp *.jpg ipad/
sips -z 2208 1242 iphone/*.jpg
sips -z 2732 2048 ipad/*.jpg
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const logger = require('morgan');
const multipart = require('connect-multiparty');
const fs = require('fs');
const shortid = require('shortid');
let app = express();