Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: ZHA Schneider Wiser 4-Button
description: Automate Schneider Wiser 4-Button remote by ZHA events.
domain: automation
input:
schneider_wiser_sw:
name: Schneider Wiser 4-Button
description: Schneider Wiser 4-Button 555 D 6001
selector:
device:
A = { 0 1 1 1 0 0 1 0 0; 1 0 0 0 1 0 1 1 0; 1 0 0 1 0 0 0 1 1; 1 0 1 0 1 1 0 0 0; 0 1 0 1 0 1 0 1 0; 0 0 0 1 1 0 1 0 1; 1 1 0 0 0 1 0 0 1; 0 1 1 0 1 0 0 0 1; 0 0 1 0 0 1 1 1 0 }
@ferrix
ferrix / wolt.py
Last active November 27, 2015 14:35
Anna mä jeesaan
def replace_with_closest_restaurant(restaurant, customer_location):
if not restaurant.isChain():
return restaurant
result = restaurant
for place in restaurant.chain.get_locations():
if place.distance(customer_location) < result.distance(customer_location):
result = place
return result

Keybase proof

I hereby claim:

  • I am ferrix on github.
  • I am ferrix (https://keybase.io/ferrix) on keybase.
  • I have a public key whose fingerprint is FF21 1A73 34C3 F1F3 F86F E8DC E907 584F F449 5D69

To claim this, I am signing this object:

@ferrix
ferrix / keybase.md
Created January 8, 2015 21:06
Keybase Proof

Keybase proof

I hereby claim:

  • I am ferrix on github.
  • I am ferrix (https://keybase.io/ferrix) on keybase.
  • I have a public key whose fingerprint is 8B9E 1F93 8239 6C93 E216 1827 E80E E0B1 04F4 597F

To claim this, I am signing this object:

@ferrix
ferrix / roflmao.pas
Last active August 29, 2015 13:56
Sometimes you have to speak C VERY LOUDLY to Ruby people
program SoooFunny;
begin
writeln('unsigned three = 1;');
end.
@ferrix
ferrix / GetAccessToken.coffee
Last active December 20, 2015 18:08
NoFlo component for getting OAuth access token.
noflo = require "noflo"
class GetAccessToken extends noflo.Component
constructor: ->
@consumer = null
@inPorts =
consumer = new noflo.Port()
in: new noflo.Port()
@outPorts =
@ferrix
ferrix / .asoundrc
Created August 23, 2012 14:11
E-MU Tracker Pre USB 2.0 Alsa configuration
pcm.emutracker_dmix {
ipc_key 1025
ipc_perm 0666
type dmix
slave {
pcm "hw:1,0"
rate 48000
format S24_3LE
period_time 0
period_size 1024
@ferrix
ferrix / middleware.py
Created July 2, 2012 06:35 — forked from mtigas/middleware.py
An SSL-enforcing middleware
from django.conf import settings
from django.http import HttpResponsePermanentRedirect, get_host
class ForceSSLMiddleware(object):
"""
Redirects all (non-DEBUG) requests to go through SSL.
Picks up the `HTTP_X_FORWARDED_PROTO` proxy header set by Heroku.
Also sets the "Strict-Transport-Security" header for 600 seconds so that