Skip to content

Instantly share code, notes, and snippets.

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

Drewry Pope dezren39

🕵️‍♂️
Processing..
View GitHub Profile
https://web.archive.org/web/20230827213236oe_/https://rr2---sn-o097znsr.googlevideo.com/videoplayback?expire=1693193544&ei=6MDrZPz_NoPEsfIPl6-0SA&ip=207.241.233.167&id=o-ACBzQKZyp0jszeO6CqqPYE7qW-fYfRrbq6DNsgzj2suE&itag=22&source=youtube&requiressl=yes&spc=UWF9f0rTWNJAJg-V-HnNOBjzn7oh4Zg&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=1586.480&lmt=1693094824771115&fexp=24007246,24350017&beids=24350017&c=ANDROID&txp=5318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhALZisByaI2kjJsEg-Xs8yX4rEwcds48yQfAwHbRWSX9vAiBRnr9IZOeAD2IsOi_nx8P7PNlcnB6g-AuLq0yMvnwskw%3D%3D&video_id=59rEiAyYEVk&redirect_counter=1&rm=sn-o09sl7l&req_id=6ca659e85c42a3ee&cms_redirect=yes&cmsv=e&ipbypass=yes&mh=4o&mip=207.241.229.236&mm=31&mn=sn-o097znsr&ms=au&mt=1693171752&mv=m&mvi=2&pl=20&lsparams=ipbypass,mh,mip,mm,mn,ms,mv,mvi,pl&lsig=AG3C_xAwRgIhAJqWiJykfj3jcf5c_OUlj2SNTYzhNx7CcQOS9NrgOe0ZAiEAiZbpnMCXnvziAKO8YP_w3nL13FzCgO7irZElAV53Ko8%3D
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
@dezren39
dezren39 / oldtwitter_style.json
Last active August 8, 2023 07:18
oldtwitter_style.json
{"customCSSVariables":"","customCSS":"#navbar {\n background-color: transparent !important;\n}\n#home {\n display: none\n}\n#left-cell {\n display: none\n}\n#right-cell {\n display: none\n}\n.container {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n#content {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n#twitter-logo-div {\n opacity: 0;\n}\n\n#navbar-right {\n margin-right: 0px;\n}\n#search-input {\n padding: 0px;\n}","font":"Arial","tweetFont":"Arial"}
@dezren39
dezren39 / oldtwitter_settings.json
Last active August 8, 2023 07:17
oldtwitter_settings.json
{"linkColorsInTL":true,"enableTwemoji":true,"timelineType":"chrono-social","showTopicTweets":true,"darkMode":true,"savePreferredQuality":false,"noBigFont":true,"language":"en","displaySensitiveContent":false,"displaySensitiveContentMoved":true,"showOriginalImages":true,"pitchBlack":true,"seeTweetViews":true,"roundAvatars":false,"twitterBlueCheckmarks":true,"developerMode":true,"copyLinksAs":"twitter.com","useNewIcon":true,"updateTimelineAutomatically":false,"showBookmarkCount":true,"showMediaCount":true,"pinProfileOnNavbar":false,"pinBookmarksOnNavbar":false,"pinListsOnNavbar":false,"useOldDefaultProfileImage":true,"enableHashflags":true,"useOldStyleReply":false,"enableAd":false,"openNotifsAsModal":true,"enableIframeNavigation":true,"acknowledgedCustomizationButton":true,"modernUI":true,"iconFont":false}
Using std::sync::LazyLock
The standard library is in the process of adding once_cell's functionality, currently called LazyLock:
#![feature(once_cell)] // 1.67.0-nightly
use std::sync::{LazyLock, Mutex};
static ARRAY: LazyLock<Mutex<Vec<u8>>> = LazyLock::new(|| Mutex::new(vec![]));
fn do_a_call() {
ARRAY.lock().unwrap().push(1);
use tailwindcss_to_rust_macros::{C, C!, M, M!};
fn main() {
let cx = /* ... */; // Context variable
view! {
cx,
<div class={C!(C::typ::text_lg, C::lay::flex)}>
"This text will have large size and flex layout"
</div>
@dezren39
dezren39 / env1-shell.nix
Created July 30, 2023 20:29 — forked from adisbladis/env1-shell.nix
Merge multilple shell.nix files using mkShell
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.hello
];
shellHook = ''
echo env1
'';
@dezren39
dezren39 / htmx-metadata.js
Created July 26, 2023 07:37 — forked from croxton/htmx-metadata.js
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') {
By submitting patches to this project you agree to allow them to be redistributed under the project's license, according to the normal forms and usages of the open-source community.
@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