Skip to content

Instantly share code, notes, and snippets.

View janLo's full-sized avatar
🤡

Jan Losinski janLo

🤡
View GitHub Profile

Work times

const tracked = {}  
const all = {  
    expected: 0,  
    actual: 0  
}  
  
dv.pages('"periodic/daily"').forEach(page => {  
import collections
import contextlib
import os
import tempfile
class Capturer(object):
STDOUT_FD = 1
STDERR_FD = 2
/**
* We need ur own slider component until
* https://github.com/mui-org/material-ui/issues/4793
* is resolved.
*/
import React, {Component} from 'react';
import {FormControl, FormHelperText, FormLabel} from 'material-ui/Form';
class ServceCallRatelimit():
def __init__(self, hass, calls_per_sec: float):
self._delay = timedelta(seconds=1.0/calls_per_sec)
self._queue = []
self._active = False
self._lock = threading.Lock()
self._next_ts = datetime.utcnow()
self._schedule = partial(track_point_in_utc_time, hass)
diff --git a/homeassistant/components/pilight.py b/homeassistant/components/pilight.py
index ec3fa04..8a78ec8 100644
--- a/homeassistant/components/pilight.py
+++ b/homeassistant/components/pilight.py
@@ -7,6 +7,9 @@ https://home-assistant.io/components/pilight/
import logging
import socket
import time
+import threading
+
@janLo
janLo / fhem.cfg
Created September 28, 2016 19:56
attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
attr global autoload_undefined_devices 1
attr global logfile ./log/fhem-%Y-%m.log
attr global modpath .
attr global motd Messages collected while initializing FHEM:\
configfile: WEB: creating device allowed_WEB for attribute basicAuth\
WEBphone: creating device allowed_WEBphone for attribute basicAuth\
attr global statefile ./log/fhem.save
attr global updateInBackground 1
class Normalizer(object):
num_samples = 100
def __init__(self, length):
self._length = length
self._array = np.zeros(length * self.num_samples, dtype='f')
self._idx = 0
def __call__(self, data):
new_idx = (self._idx + self._length) % len(self._array)
#!/usr/bin/env python
import pyaudio
import struct
import sys
import argparse
import numpy as np
from PIL import Image
#!/usr/bin/env python
import pyaudio
import struct
import sys
import argparse
import numpy as np
from PIL import Image
import pyaudio
import struct
import sys
import numpy as np
from blinkstick import blinkstick
from PIL import Image
import time