Skip to content

Instantly share code, notes, and snippets.

View shannon's full-sized avatar

Shannon Poole shannon

  • Red Hat, Inc.
  • Massachusetts, USA
View GitHub Profile
@shannon
shannon / ikea_tradfri_5button_remote.yaml
Last active January 6, 2022 22:00 — forked from niro1987/zha_ikea_tradfri_5button_remote_color.yaml
Home Assistant - Blueprint - IKEA TRADFRI 5 Button Remote
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through ZHA.
# | Button | Action |
# | -------- | ------------------- |
# | Power | Toggle the light |
# | Dim-Up | Increase brightness |
# | Dim-Down | Decrease brightness |
# | Right | Increate color temp |
@shannon
shannon / ikea_tradfri_2button_dimmer.yaml
Last active February 19, 2021 23:37 — forked from niro1987/zha_ikea_tradfri_2button_remote_brightness.yaml
Home Assistant - Blueprint - IKEA TRADFRI 2 Button Dimmer
---
# This automation simulates the use of the IKEA TRADFRI Dimmer control
# connected through ZHA.
# | Button | Action |
# | ----------- | ------------------- |
# | on (short) | Turn the light on |
# | off (short) | Turn the light off |
# | on (long) | Increase brightness |
# | off (long) | Decrease brightness |
@shannon
shannon / present_mode.sh
Last active March 12, 2020 18:40
Lakka Present Mode (Cycle through playlist on boot)
#!/bin/sh
#present_mode.sh
nohup /storage/.config/present_mode_input.sh &
INPUT_PID=$!
while true
do
RA_RUNNING=`ps -A | grep retroarch | grep -v grep | wc -l`
if [ 1 == $RA_RUNNING ] ; then
@shannon
shannon / README.md
Last active February 18, 2020 19:05
Adding simple log levels to console logging

Example:

import log from './simple-log.js'

log.level = 'info';

log.trace('should NOOP');
log.debug('should NOOP');
log.info('should output');
log.log('should output');
@shannon
shannon / notes.md
Last active September 30, 2019 22:07
The following models and their accessors have incorrect counts based on the decompressed result from draco.

Sample Models location: https://github.com/KhronosGroup/glTF-Sample-Models/tree/18912e96c60245f71a3775d365c990009307a11a/2.0/

see https://github.com/KhronosGroup/glTF/blob/1aae8e9084a5966c61f810dd3a3186fe084b642b/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md#implementation-note

The following output shows where count === accessor.count and num_points === dracoGeometry.num_points() (or num_points === dracoGeometry.num_faces() * 3 in the case of indices) for each accessor that was determined not to match.

2CylinderEngine

accessor: 1 (NORMAL), mesh: 0 (Piston_123-844_0_Parts_1), primitive: 0, count: 2012, num_points: 2019
@shannon
shannon / index.html
Created March 21, 2019 00:55
HTML5 Meetup Custom Elements
<!DOCTYPE html>
<html>
<head>
<script type="module">
import { render, html } from 'https://unpkg.com/lit-html?module';
class SourceViewElement extends HTMLElement {
constructor() {
super();
> cpuinfo@0.0.2 test /data/data/com.termux/files/home/cpuinfo
> node ./testcases.js
Testing cpuinfo for node-js
{ http_parser: '2.7.0',
node: '9.2.0',
v8: '6.2.414.44-node.11',
uv: '1.16.1',
zlib: '1.2.8',
ares: '1.13.0',
0 info it worked if it ends with ok
1 verbose cli [ '/data/data/com.termux/files/usr/bin/node',
1 verbose cli '/data/data/com.termux/files/usr/bin/npm',
1 verbose cli 'i',
1 verbose cli '-g',
1 verbose cli 'http-server' ]
2 info using npm@5.5.1
3 info using node@v8.9.1
4 verbose npm-session 456b325fdfcd5991
5 verbose stack TypeError: Cannot read property 'length' of undefined
@shannon
shannon / angular-typeout.js
Last active October 30, 2015 18:57
Simple angular typeout directive
angular.module('typeOut', [])
.directive('typeOut', ["$timeout", function($timeout){
return {
restrict: 'A',
scope: {
text: '=typeOut',
speed: '=typeOutSpeed',
onComplete: '&',
},
link: function($scope, elem, attrs){
@shannon
shannon / foo.js
Created July 6, 2015 15:20
Modular routes
var express = require('express');
var router = express.Router();
// my few includes
require('./foo_1')(router);
require('./foo_2')(router);
module.exports = router;