Skip to content

Instantly share code, notes, and snippets.

View dezren39's full-sized avatar
🕵️‍♂️
Processing..

Drewry Pope dezren39

🕵️‍♂️
Processing..
View GitHub Profile
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install charm
# this file goes in $HOME/.config/systemd/user
[Unit]
Description=beepy backlight controller
[Service]
Type=simple
# adjust this path to where you wrote the script out
ExecStart=/home/rj/bin/noarch/beepy-bl.sh
Restart=on-failure
import RPi.GPIO as GPIO
import datetime
import os
import time
BUTTON_PIN = 17
SHORT_PRESS_TIME = 0.5 # Less than 0.5 seconds
REPEAT_TIMEOUT = 0.5 # Repeat short presses should be within 1s
MEDIUM_PRESS_TIME = 2 # Less than 2.0 seconds
# this file goes in $HOME/.config/systemd/user
[Unit]
Description=beepy backlight controller
[Service]
Type=simple
# adjust this path to where you wrote the script out
ExecStart=/home/rj/bin/noarch/beepy-bl.sh
Restart=on-failure
@dezren39
dezren39 / contributor-license-agreement.md
Last active April 18, 2023 23:12
Contributor License Agreement

Thank you for your interest in contributing to developing.today LLC ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us.

How to use this Contributor Agreement

If You are an employee and have created the Contribution as part of your employment, You need to have Your employer approve this Agreement or sign a copy of this document on behalf of the Entity. If You do not own the Copyright in the entire work of authorship, any other author of the Contribution should also sign this – in any event, please contact Us at cla@developing.today

1. Definitions

@jxsl13
jxsl13 / koanf.go
Last active December 24, 2023 15:45
Koanf and Cobra integration
package config
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"
@croxton
croxton / htmx-metadata.js
Created October 13, 2022 13:46
Htmx swapping metadata
htmx.on('htmx:beforeSwap', (htmxEvent) => {
let incomingDOM = new DOMParser().parseFromString(htmxEvent.detail.xhr.response, "text/html");
// Transpose <meta> data, page-specific <link> tags and JSON-LD structured data
// Note that hx-boost automatically swaps the <title> tag
let selector = "head > meta:not([data-revision]), head *[rel=\"canonical\"], head *[rel=\"alternate\"], body script[type=\"application/ld+json\"]";
document.querySelectorAll(selector).forEach((e) => {
e.parentNode.removeChild(e);
});
incomingDOM.querySelectorAll(selector).forEach((e) => {
if (e.tagName === 'SCRIPT') {
@dezren39
dezren39 / consul-firewalld.md
Created August 11, 2022 21:57 — forked from mbillow/consul-firewalld.md
Consul FirewallD Service Definition

Consul FirewallD Service Definition

A simple service definition for Consul agents; meant to simplify the installation process of Consul.

This is based on the information provided by Hashicorp in the Consul Docs.

Installation

  1. Download the XML file:
  • Either wget {raw_url} consul.xml
$Path = $env:TEMP
$Installer = "chrome_installer.exe"
Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer
Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait
Remove-Item $Path$Installer
@matthewpi
matthewpi / README.md
Last active May 6, 2024 14:16
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue