Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@blurymind
blurymind / webkit-pseudo-elements.md
Created August 28, 2026 08:34 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

How to Interact with Shadow DOM Elements: A Developer’s Guide to Automation

This article presents is a comprehensive guide on how to extract the path to Shadow DOM elements (the “shadow path”) and then use that path to interact with those elements—whether that’s setting values, firing events, or clicking buttons. We’ll walk through:

  1. Why Shadow DOM poses unique challenges for automation.
  2. How to generate a shadow path for nested elements.
  3. Why setting values and clicking buttons in Shadow DOM sometimes fails if done “the usual way.”
  4. A working solution that shows how to properly set values on custom elements, trigger events, and click buttons.

Use this article both to understand the concepts and to train a GPT bot or any developer on the intricacies of Shadow DOM automation.

@t3dotgg
t3dotgg / try-catch.ts
Last active November 5, 2026 16:28
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@rapando
rapando / download.rs
Last active August 6, 2026 13:16
Download in rust
use indicatif::{ProgressBar, ProgressStyle};
use reqwest::blocking::{get, Client};
use std::{
error,
fs::File,
io::{Seek, SeekFrom, Write},
sync::{mpsc, Arc, Mutex},
thread,
time::Instant,
};
@joshkay
joshkay / DataTable.tsx
Created May 21, 2024 18:39
TanStack cell selection
"use client";
import {
type ColumnDef,
flexRender,
getCoreRowModel,
useReactTable,
getPaginationRowModel,
getSortedRowModel,
getFilteredRowModel,
@Ephraim-Bryski
Ephraim-Bryski / client.js
Last active June 25, 2025 17:52
reading and writing files in electron
const FILE_A = 'a.json'
const FILE_B = 'b.json'
const files = [FILE_A,FILE_B]
const contents = {}
window.api.receive("sendReadContent", (file_name,data) => {
@srestraj
srestraj / frame-extractor.md
Last active June 11, 2025 18:01
Extract video frame from a file input using JS and Canvas
Create an input element to let users upload a video
<label for="file">Upload Video</label> 
<input type="file" accept=".mp4, .mkv, .mpeg4" id="file" class="video-input">
<button class="capture-btn">Capture</button>
<div class="source-vid"></div>
<div class="result"></div>
@red-dragon65
red-dragon65 / Deck ui.md
Last active February 21, 2024 16:26
How to properly run Steam Decks UI on Manjaro

This guide is deprecated! Please take a look at the alternative solutions below.

This guide was created to run the steam deck ui on a linux desktop before valve officially updated big picture mode for the steam client. This guide no longer serves any purpose.

Big Picture Mode

  • The steam client now officially uses the steam deck ui (gamepad ui) for big picture mode.

HoloISO

  • A reversed engineered version of valves steam deck OS
@MichaelPHolstein
MichaelPHolstein / script.js
Last active April 18, 2023 17:29
JavaScript file of background removal using Tensorflow and bodyPix
IMAGE_SRC = './img/8.jpg'
const loadImage = () => {
const img = new Image()
img.src = IMAGE_SRC
const canvas = document.querySelector('canvas')
const ctx = canvas.getContext('2d')
img.addEventListener('load', () => {
@FGRibreau
FGRibreau / HeaderValueExt.rs
Last active August 24, 2026 11:11
Convert a HeaderValue into a rust String
/// Additional conversion methods for `HeaderValue`.
pub trait HeaderValueExt {
fn to_string(&self) -> String;
}
impl HeaderValueExt for HeaderValue {
fn to_string(&self) -> String {
self.to_str().unwrap_or_default().to_string()
}
}