📘 LAMP 📕 MySQL 📘 Terminal 📘 htaccess
# System and PiHole stats for 128x32 OLED screen | |
# | |
# Add to: `/etc/rc.local` for boot start. | |
# | |
# @author learn.adafruit.com, davidsword | |
# @link https://gist.github.com/davidsword/0e9556ac19b5ef02d93d73931fec659e | |
# @version 20210131 | |
import time | |
import subprocess |
State | Slack Status Emoji | Slack Presense | Busy Light |
---|---|---|---|
Active | 🟢 | 🟢 | |
In a Meeting | red-dot | 🟢 | 🔴 |
On Call | red-dot | 🟢 | 🔴 |
Red | 🟢 | 🔴 | |
Busy | red-dot | ⚪️ | 🔴 |
BRB | yellow-dot | ⚪️ | 🟡 |
Lunch | yellow-dot | ⚪️ | 🟡 |
Family | yellow-dot | ⚪️ | 🟡 |
/* ESP8266 NodeMCU RGB LED Busy Server | |
* | |
* Set an RGB LED to current status via web request | |
* | |
* 1. Flash this file to a ESP-12E | |
* 2. Open Serial to get the IP address of board | |
* 3. Optionally set a dedicated DHCP reservation at the router level to ensure same IP address is used | |
* 4. Connect common anode or common cathode RGB LED (see pins below) | |
* 5. Make `GET` request to `http://<IP>/<status>` | |
* |
# https://davidsword.ca/a-cheaper-diy-status-light/ | |
import sys | |
import RPi.GPIO as GPIO | |
GPIO.setwarnings(False) | |
# Note this is BOARD numbering. | |
GPIO.setmode(GPIO.BOARD) | |
redPin = 3 |
# https://davidsword.ca/learning-to-count-to-5-with-a-raspberry-pi/ | |
import time | |
import busio | |
import adafruit_ssd1306 | |
import RPi.GPIO as GPIO | |
from board import SCL, SDA | |
from PIL import Image, ImageDraw, ImageFont | |
# settings |
GH_TOKEN="" | |
GH_REPO="" | |
GH_OWNER="" | |
GH_SHA="" | |
# Get the PULL number that's realted to the commit on this build | |
PULL=$(curl -H "Authorization: bearer ${GH_TOKEN}" -s -d "{ \ | |
\"query\": \"query { \ | |
repository(owner: \\\"$GH_OWNER\\\", name: \\\"$GH_REPO\\\") { \ | |
commit: object(expression: \\\"$GH_SHA\\\") { \ |
<style type="text/css"> | |
:root { | |
--padding: 2px; | |
--size: 5px; | |
--total: 7px; | |
} | |
body { | |
background: black; | |
padding:2px; | |
margin:0; |
<?php | |
/** | |
* Example of Cache Varients on VIP Go | |
* | |
* @see https://github.com/Automattic/vip-go-mu-plugins/blob/master/cache/examples/segmentation-maintenance-mode-bypass/vip-config.php | |
*/ | |
function x_cache_seg() { | |
// Set the response header to let CDN know of possible varient. | |
header( 'Vary: X-VIP-Go-Segmentation' ); |
<a href='#' data-darkmode-btn>Toggle Darkmode</a> | |
<script type="text/javascript"> | |
/* eslint-disable */ | |
var darkModeBtn = document.querySelector('a[data-darkmode-btn]'); | |
var bodyEle = document.querySelector('body'); | |
if (localStorage.getItem('darkmode') === 'yes') { | |
bodyEle.classList.add("darkmode"); | |
} | |
function darkmodetoggle(e) { |