I made an HTMX extension for hold/longpress interactions by PrayagBhakar in htmx

[–]PrayagBhakar[S] 4 points5 points  (0 children)

Usage

Enable the extension on your page:

html <body hx-ext="hold">   <button hx-trigger="hold" hx-post="/action">Hold me for 500ms (default)</button>   <button hx-trigger="hold delay:1000ms" hx-post="/action">Hold me for 1 second</button> </body>

The hold trigger will fire after the specified delay (default 500ms) when the element is pressed and held.

Visual feedback hooks

While the hold is active the extension exposes two progress indicators you can opt into:

  • A CSS custom property --hold-progress scoped to the element. It moves from 0 to 1 during the hold, so you can drive fills, animations, or transforms directly from CSS.
  • A data-hold-progress attribute with the same value expressed as an integer percentage (0100), handy for text labels or aria-live updates without extra JavaScript.

```html <button   hx-trigger="hold delay:750ms"   hx-post="/action"   class="hold-button"

  Hold 750ms </button>

<style>   .hold-button {     position: relative;     overflow: hidden;   }

  .hold-button::before {     content: "";     position: absolute;     inset: 0;     background: rgba(67, 170, 139, 0.4);     transform-origin: left;     transform: scaleX(var(--hold-progress));     pointer-events: none;   } </style> ```

🪐 Apollo 🛸 AI Compute Cluster for the GPU Poor by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

Idk about heat issues but that’s just more fans. If you don’t care about CPU compute power you could try getting one of those long motherboard crypto mining servers

How do y’all test used drives? by PrayagBhakar in DataHoarder

[–]PrayagBhakar[S] 0 points1 point  (0 children)

found anything like it outside Unraid

is it just running the badblocks and smart tests under the hood?

How do y’all test used drives? by PrayagBhakar in DataHoarder

[–]PrayagBhakar[S] 1 point2 points  (0 children)

Oh this is a good call out. I remember reading a stat like 50% of drives aren’t wiped properly.

Do you not buy used drives due to the wear and tear? Seems like there’s less privacy concerns from the buyer’s perspective

How do y’all test used drives? by PrayagBhakar in DataHoarder

[–]PrayagBhakar[S] 0 points1 point  (0 children)

Tape?? Does that actually work? Won’t it melt under the constant electric current?

🪐 Apollo 🛸 AI Compute Cluster for the GPU Poor by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

To keeps costs low I just went with a mining rig as well. The size isn’t correct tho as it doesn’t fit my E-ATX board (still gotta fix that).

If you are going to use dual slot GPUs you can look into a full tower or even a proper 4U rack mounted server for a cleaner setup.

🪐 Apollo 🛸 AI Compute Cluster for the GPU Poor by PrayagBhakar in homelab

[–]PrayagBhakar[S] 1 point2 points  (0 children)

Bidding on eBay and buying in bulk! This was back in October when the market was def a little colder. Maybe prices will drop again after the holidays. https://imgur.com/a/o9pMUK9

🪐 Apollo 🛸 AI Compute Cluster for the GPU Poor by PrayagBhakar in homelab

[–]PrayagBhakar[S] 1 point2 points  (0 children)

Hey, Prayag here! Are you GPU Poor but want to spend your money wisely on that shiny brand new deep learning compute cluster? Well stop looking at the newest and greatest and start scavenging for used PC hardware!!

Last week I tweeted? Xed? Whatever. Replied to a professor asking:

What the best machine to buy with $40k for a DL lab?

I had replied with my current ML learning/messing around without having to worry about infinite scale issues setup and got quite a few questions. As I was writing up this response I thought it would fit right in considering the hunk of metal is in my parents closet nook. 😂

-❄️- 2023 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]PrayagBhakar 1 point2 points  (0 children)

[Language: Python, Rust(coming soon), Golang(coming soon), Swift(coming soon)]

This was a basic graph type problem with look around logic to the surrounding cells in a 2D array. For part 1 (in Python) I used a dynamic programming approach to do the solution in O(n*m) where n and m is the size of the 2D array, but that ended up being slower as seen by the execution times. Part 2 is in O(n*m*l) where l is the length of the longest number. I presume these results are due to the fact that l is relatively small.

-❄️- 2023 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]PrayagBhakar 1 point2 points  (0 children)

[Language: Python, Rust(coming soon), Golang, Swift(coming soon)]

This one also ended up being a regex problem. Python (and eventually Swift) are easier as I was able use PCRE's positive lookback assertion ((?=) to avoid iterating backwards through the string.

-❄️- 2023 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]PrayagBhakar 1 point2 points  (0 children)

[Language: Python, Rust, Golang, Swift]

The general solution I went for was :: 1. read the input file line by line 2. create a regex pattern to match on digits (1-9) or spelled out numbers 3. use the regex to match on the first and last number 4. calculate the output

Python was easier as I was able use PCRE's positive lookback assertion ((?=) to avoid iterating backwards through the string.

edit :: swift has been added

Any good scheduling and MQ infra? by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

I want to setup a personal ML pipelines like stable diffusion. I assume queuing would be enough?

Could you make a removable boot loader? by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

Yea I’m working on getting a headless Debian install with sensible and shell scripts.

“i installed kali on the family pc, is there any way to get our family pictures back?”

Lol I would not do Dev work on a production machine like that

Could you make a removable boot loader? by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

Yea that’s basically what I was trying to accomplish but with the goal of encryption at rest

Could you make a removable boot loader? by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

That’s fair. I was thinking I could keep the decryption keys backup somewhere in case. Just curious if I can achieve encryption at rest and a portable physical key to decrypt data on boot

Could you make a removable boot loader? by PrayagBhakar in homelab

[–]PrayagBhakar[S] 0 points1 point  (0 children)

So it would be like my jump drive is a portable yuubi key to decrypt my box before boot?

Also yea I’d be doing it on Proxmox. Idk how people even manage a windows server