Skip to content

Instantly share code, notes, and snippets.

Avatar

raspberrypisig

View GitHub Profile
View hello2.bas
'type suffix (default integer, ! for float, % for number, $ for string)
STATE=1
SUB SETUP
PRINT "Running setup..."
END SUB
SUB MAIN
View hello.bas
'type suffix (default integer, ! for float, % for number, $ for string)
SUB SETUP
PRINT "Running setup..."
END SUB
SUB MAIN(STATE)
IF STATE = 1 THEN
PRINT "Doing nothing..."
@raspberrypisig
raspberrypisig / __init__.py
Created Sep 4, 2020
customcomponent-explorer_media
View __init__.py
"""Example of a custom component exposing a service."""
import asyncio
import logging
from homeassistant.core import callback
# The domain of your component. Should be equal to the name of your component.
DOMAIN = "explorer_media"
_LOGGER = logging.getLogger(__name__)
View network_explorer.flow
[{"id":"41fe5fcf.230f8","type":"tab","label":"media player","disabled":false,"info":""},{"id":"18502263.faee2e","type":"inject","z":"41fe5fcf.230f8","name":"NETWORK_EXPLORER","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"NETWORK_EXPLORER","payload":"http://192.168.20.99:8002","payloadType":"str","x":210,"y":160,"wires":[["a066cf65.6e121"]]},{"id":"cc0d39f1.734978","type":"debug","z":"41fe5fcf.230f8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":60,"wires":[]},{"id":"153eec34.3f0de4","type":"http request","z":"41fe5fcf.230f8","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":650,"y":200,"wires":[["3ad66e1.9686e92"]]},{"id":"a066cf65.6e121","type":"function","z":"41fe5fcf.230f8","name":"","func":"msg.url = msg.payload + \"/api/directories\";\nreturn msg;","outputs":1,"noerr":0,"initi
View streaming.py
from flask import Flask, request, Response
import requests
PROXY_URL = 'http://ipv4.download.thinkbroadband.com/'
def download_file(streamable):
with streamable as stream:
stream.raise_for_status()
for chunk in stream.iter_content(chunk_size=8192):
yield chunk
@raspberrypisig
raspberrypisig / nginx.conf
Last active Aug 19, 2020 — forked from foxxyz/nginx.conf
Serve current directory via nginx
View nginx.conf
# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
include /usr/local/etc/nginx/mime.types;
@raspberrypisig
raspberrypisig / zsh-elapsed-time.md
Created Jun 24, 2020 — forked from knadh/zsh-elapsed-time.md
Elapsed and execution time for commands in ZSH
View zsh-elapsed-time.md

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
  timer=$(($(date +%s%0N)/1000000))
View MohanCurtain.ino
#define DIR_PIN 4 // Working
#define STEP_PIN 5 //
#define ENABLE_PIN 6 //
#define OPENED_LIMIT_PIN 7 //
#define CLOSED_LIMIT_PIN 8
#define OPEN_PIN 11 //
#define CLOSE_PIN 12
int moveAwayFromLimit = 200;
boolean bStartPressed = false;
View homeassistant_storepreviousstate.yaml
#input_number:
# start_of_day_vix:
# name: Start of Day VIX
# min: 0
# max: 1000000
counter:
start_of_day_count:
name: Rob Start of Day Count
minimum: 0
You can’t perform that action at this time.