This code is usable only if you are on Home Assistant 0.114 or older
For Home Assistant 0.115 and newer please go to: https://github.com/AdamNaj/ZWaveGraphHA
#!/usr/bin/env python3 | |
# Based on https://github.com/EraYaN/jellyfin-stats | |
# pip3 install requests tqdm | |
URL = "" | |
API_KEY = "" | |
from re import sub | |
import requests | |
from tqdm import tqdm |
This code is usable only if you are on Home Assistant 0.114 or older
For Home Assistant 0.115 and newer please go to: https://github.com/AdamNaj/ZWaveGraphHA
UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).
If you are getting the error: No space left on device
Configuring the qcow2 size cap is possible in the current versions:
# my disk is currently 64GiB
#!/usr/bin/env python | |
# encoding: utf-8 | |
import time | |
import socket | |
from tornado.iostream import IOStream | |
from tornado.ioloop import IOLoop | |
from tornado import stack_context | |
import functools | |
import collections |
#!/usr/bin/env python | |
## Tiny Syslog Server in Python. | |
## | |
## This is a tiny syslog server that is able to receive UDP based syslog | |
## entries on a specified port and save them to a file. | |
## That's it... it does nothing else... | |
## There are a few configuration parameters. | |
LOG_FILE = 'youlogfile.log' |
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
import functools | |
import sys | |
import re | |
from django.conf import settings | |
from django.db import connection | |
def shrink_select(sql): | |
return re.sub("^SELECT(.+)FROM", "SELECT .. FROM", sql) | |
def shrink_update(sql): |
# -*- coding: utf-8 -*- | |
""" | |
На работе как-то раз появилась довольно стандартная задача: | |
написать генаратор, который отдаёт элементы из некого итератора пачками | |
по n элементов. | |
Дополнительное условие: | |
Не возвращать пустой список на последней итерации (возникает, когда | |
общее количество элементов кратно размеру пачки). | |
В общем, как-то её в тот раз решили, хоть и не слишком красиво. |
During the last year, I have worked on couple of Ruby/Rails based projects where the primary datastore was CouchDB. CouchDB, to me, is a dream database for web developer come true. The simplicity, the HTTP-based API, the abandonment of SQL semantics, the inspiring community, that all reminds me of when I came into Rails years ago.
However, working with Couch in Ruby and Rails is very, very painful, in my opinion. I'd like to briefly summarize some of my frustrations here. Maybe they are shared, maybe not -- if they are, I think we should launch some coordinate effort to make using Couch in Ruby a pleasure and intelectual satisfaction, not endless loops of research and hacks to „make it work“.
Please note, that my interest is solely to stir the debate. I may be severely mistaken in any point. But, I'd like using Couch in a Ruby application to be a joy, not a frustration, which is what I've met more times than I'd ha