Skip to content

Instantly share code, notes, and snippets.

View shift's full-sized avatar

Vincent Palmer shift

View GitHub Profile
blueprint:
name: Motion-activated Light
domain: automation
source_url: https://gist.github.com/shift/d3225b4bb5d658893f70ea7b8358721c#file-motion_activated-_light-yaml
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
@shift
shift / cursed_mandelbrot.c
Created November 14, 2018 14:21 — forked from DavidBuchanan314/cursed_mandelbrot.c
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@shift
shift / edgerouter-qos
Created February 8, 2016 21:47 — forked from beardicus/edgerouter-qos
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit