Skip to content

Instantly share code, notes, and snippets.

View polishdeveloper's full-sized avatar

Piotr Miazga polishdeveloper

View GitHub Profile
@polishdeveloper
polishdeveloper / config.yaml
Created October 3, 2018 20:31
Sample HA config for Hikvision Camera - camera preview + motion detection and automation to switch off lights using rf switch when there is no motion for 15 mins
ffmpeg:
camera:
- platform: mjpeg
mjpeg_url: http://192.168.202.183/Streaming/channels/2/preview
username: !secret hikvision_user
password: !secret hikvision_pass
binary_sensor:
# Hallway
- platform: hikvision
@polishdeveloper
polishdeveloper / PagePreviewsBucketerForAnon.js
Last active April 17, 2018 13:07
Bucket yourself as anonymous user who can see PagePreviews on Wikipedia
var sessId = 0,
bucket = 'off';
weightedBoolean = function getUserBucket( experiments, experimentGroupSize, sessionId ) {
const control = experimentGroupSize / 2;
if ( !experimentGroupSize ) {
return 'on';
}
return experiments.getBucket( {
name: 'ext.Popups.visibility',
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(21,GPIO.OUT)
for i in range(5):
print "LED on"
GPIO.output(21,GPIO.HIGH)
time.sleep(1)
print "LED off"

Keybase proof

I hereby claim:

  • I am polishdeveloper on github.
  • I am raynor (https://keybase.io/raynor) on keybase.
  • I have a public key ASD27Vno0aOwkshL4dckUwFUivUjfNQh2DS3vV2OTHikxwo

To claim this, I am signing this object:

curl -s "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&generator=random&redirects=1&exsentences=2&exlimit=1&explaintext=1&exsectionformat=plain&grnnamespace=0&grnfilterredir=nonredirects&formatversion=2" | python -c 'import sys, json; resp = json.load(sys.stdin); print unicode(resp["query"]["pages"][0]["title"] + ". " + resp["query"]["pages"][0]["extract"]).encode("utf-8")'| say
#!/usr/bin/php
<?php
class ComposerLockUpdater {
private $vendor;
private $lockData;
private $packageIdx = false;
private $composerLockPath;