This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Qtile 0.8.0 | |
# sysd widget sample | |
class Sysd(base.ThreadedPollText): | |
defaults = [ | |
( | |
'api_url_root', | |
'http://127.0.0.1:8080/', | |
'API URL Root' | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
base='/home/yan/.irssi/irclogs/freenode/#h4' | |
inotifywait -m -r -e create -e modify -e close_write --exclude "\.git/*" $base | while read res | |
do | |
event=`echo $res | awk '{print $2'}` | |
file=`echo $res | awk '{print $3'}` | |
echo $res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from hackpad_api import hackpad | |
from xmlrpclib import ServerProxy | |
from datetime import datetime | |
config = {'hackpad': {}, 'wikidot': {}} | |
config['hackpad']['subdomain'] = 'hackingthursday' | |
config['hackpad']['client_id'] = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import cv2 | |
import numpy as np | |
READ_PICTURE = 1 # 0 => read from camera | |
PICTURE_PATH = "sample.jpg" | |
THRESHOLD = 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
import requests | |
DEV_ID = '' # MiFlora MAC | |
url = 'https://api.ohg.ag/iot/data/%s' % DEV_ID | |
sensor_data = [1970, 59, 26.2, 1376] # 光照, 水分, 溫度, 肥力 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
open-homeautomation/miflora | |
https://github.com/open-homeautomation/miflora | |
''' | |
from btlewrap import available_backends, BluepyBackend, GatttoolBackend, PygattBackend |