Instance events (such as canvas) are announced in the [email protected] community

1
1
submitted 1 hour ago by [email protected] to c/javascript

I can do this manually using the following: Right-click on the video player, copy debug info, paste into text editor, and Ctrl+F for "addocid".

What is the best way to do this automatically?

By modifying an ad accelerator I found, I can reliably detect when a pre-roll ad is playing:

function handleVideoAd() {
	const video = document.querySelector('video');
	const adElement = document.querySelector('.video-ads.ytp-ad-module');
	if (video && adElement && adElement.children.length > 0) {
		alert('advertisement found!')
	}
}

function initializeAdHandling() {
	handleVideoAd();
	const observer = new MutationObserver(handleVideoAd);
	observer.observe(document.body, { childList: true, subtree: true });
}
initializeAdHandling()

If I had the video ID, I could then open the video in a new tab using something like:

window.open('https://www.youtube.com/watch?v=adVideoID');

However, I am at a bit of a loss as to how to extract the ad video ID itself.

In the browser inspector, the only places I can find the ad video ID are:

  1. Within the URL for ytp-cued-thumbnail-overlay-image
  2. As adVideoId within var ytInitialPlayerResponse, which itself is within <script nonce="rwc3vYf3vRLEyNQKsJOgig">, where rwc3vYf3vRLEyNQKsJOgig changes with every video.

What would be the best way to extract the advertisement video ID?

Apologies for if I'm going about this the wrong way. I am (very!) new to JavaScript, but interested in learning. Please let me know if I've broken any community rules, or committed any other sort of faux pas. Thanks! :)

2
1
submitted 1 hour ago by [email protected] to c/latex

cross-posted from: https://beehaw.org/post/13830031

Just learning LaTeX; apologies for the noobie-type question.

3
4
Day 9 - Diving into networking (linuxupskillchallenge.org)
submitted 3 hours ago by livialima to c/linuxupskillchallenge
4
11
submitted 6 hours ago by [email protected] to c/ask_experienced_devs

Hello. Like many of you I've been affected by the wave of layoffs and am struggling to even get a response for most of my applications.

I've recently been talking to a local manufacturing plant about employment regarding full stack development, but they told me they would only be willing to contract me. While this still leaves me without health insurance (USA), beggars can't be choosers.

The issue is, I'm early in my career and have never dabbled in contract work. They haven't been specific about what they want to contract me for as well, just asked me for an hourly rate.

I unfortunately have to dox myself, but I would really appreciate if anyone could take a look over my portfolio/resume and let me know what my worth is. Granted I would likely charge more if I was writing them a high performance Rust program as compared to some Python scripts, but I don't think I have the luxury of nuance.

Thank you, I appreciate it.

https://johnrigoni.me

Aside: I have an appointment to get a professional headshot next week, I know it's not great.

5
375
submitted 12 hours ago by [email protected] to c/programmer_humor
6
7
Raspberry Pi Ltd is considering an IPO (www.londonstockexchange.com)
submitted 8 hours ago by [email protected] to c/raspberry_pi

"Raspberry Pi Ltd, a leader in low-cost, high-performance computing, announces that it is considering an initial public offering (the "IPO" or the "Offer") and that it intends to publish today a registration document (the "Registration Document"). The Company is considering applying for admission of its ordinary shares to the premium listing segment of the Official List of the FCA and to trading on the Main Market of the London Stock Exchange ("Admission")."

7
6
submitted 10 hours ago by [email protected] to c/react
8
19
submitted 13 hours ago by popcar2 to c/godot
9
9
submitted 11 hours ago by nieceandtows to c/meta

Invalid SSL certificate Error code 526

Including for me.programming.dev

10
17
State of HTML 2023 (2023.stateofhtml.com)
submitted 14 hours ago by [email protected] to c/webdev

Results of the State of HTML 2023 Survey are out.

11
1071
submitted 1 day ago by [email protected] to c/programmer_humor
12
209
Go vs Rust learning (programming.dev)
submitted 22 hours ago by zinderic to c/programmer_humor
13
12
State of HTML 2023 (2023.stateofhtml.com)
submitted 14 hours ago by [email protected] to c/programming

cross-posted from: https://lemmy.world/post/15433712

State of HTML 2023

Results of the State of HTML 2023 Survey are out.

14
76
submitted 19 hours ago by onlinepersona to c/programming

I've heard it thrown around in professional circles and how everybody's doing it wrong, so.. who actually does use it?

For smaller teams

"scaled" trunk based development

15
13
My LaTeX book (lemmy.world)
submitted 14 hours ago by [email protected] to c/cool_github_projects

Better design, new features and readme.

... and this is the most popular open source LaTeX book on github ❤️

https://github.com/AnMnv/eBook

16
9
submitted 13 hours ago by [email protected] to c/react
17
13
submitted 15 hours ago by [email protected] to c/terraform
18
13
submitted 16 hours ago by canpolat to c/git
19
3
submitted 12 hours ago* (last edited 12 hours ago) by Hammerheart to c/linux4noobs

I have been using sway (basically i3 for Wayland) instead of a traditional desktop environment because it really makes a difference in my laptops performance.

But apparently sway ignores .desktop files which was how i was autostarting things on KDE.

Is the best way to handle this by going through the sway config? If not, how would you do it.

Bonus points if you can tell me how to get the autostart programs to also open in specific workspaces.

20
7
LaTeX book in 2024? (lemmy.world)
submitted 14 hours ago by [email protected] to c/opensource

Better design, new features and readme.

... and this is the most popular open source LaTeX book on github ❤️

https://github.com/AnMnv/eBook

21
45
Fedora rock!!! (lemmy.ca)
submitted 22 hours ago by [email protected] to c/linux4noobs

Previously used Endeavors, OpenSUSE, PopOS and GTA run 5 fps now on Fedora it run 25-40fps 1080 high

22
5
submitted 14 hours ago by notnotmike to c/rider

Around two years ago I was on a really small team, just two or three developers, and the other developer decided they wanted us to use Rider. Because I didn't have a preference, I used Rider and rather enjoyed it. However, that developer has since moved teams and now it is just me (for the time being).

So I was considering moving back to Visual Studio or even switching to Visual Studio Code, but I wanted to see some arguments against this.

Here is my list so far, but it's probably out of date since I haven't used Visual Studio in a long time.

Pros of Rider:

  • Much faster than using ReSharper
  • Less sharp interface with a better font
  • I'm used to it at this point
  • I have a Nyan cat loading bar which is kind of fun

Cons of Rider:

  • Enterprise license is expensive (probably)
  • New versions of C# aren't immediately supported
  • Refactorings are becoming less necessary with the rise of AI assistants
  • Don't really like their source control manager

Wanted to hear what other users think. What keeps you using Rider?

23
1
submitted 11 hours ago by canpolat to c/dotnet
24
3
submitted 15 hours ago by [email protected] to c/latex

Better design, new features and readme.

... and this is the most popular open source LaTeX book on github ❤️

https://github.com/AnMnv/eBook

25
75
submitted 1 day ago by ChubakPDP11 to c/programmer_humor
view more: next ›

programming.dev

8,236 readers
423 users here now

Welcome Programmers!

programming.dev is a collection of programming communities and other topics relevant to software engineers, hackers, roboticists, hardware and software enthusiasts, and more.

The site is primarily english with some communities in other languages. We are connected to many other sites using the activitypub protocol that you can view posts from in the "all" tab while the "local" tab shows posts on our site.


🔗 Site with links to all relevant programming.dev sites

🟩 Not a fan of the default UI? We have alternate frontends we host that you can view the same content from

ℹ️ We have a wiki site that communities can host documents on


⚖️ All users are expected to follow our Code of Conduct and the other various documents on our legal site

❤️ The site is run by a team of volunteers. If youre interested in donating to help fund things such as server costs you can do so here

💬 We have a microblog site aimed towards programmers available at https://bytes.programming.dev

🛠️ We have a forgejo instance for hosting git repositories relating to our site and the fediverse. If you have a project that relates and follows our Code of Conduct feel free to host it there and if you have ideas for things to improve our sites feel free to create issues in the relevant repositories. To go along with the instance we also have a site for sharing small code snippets that might be too small for their own repository.

🌲 We have a discord server and a matrix space for chatting with other members of the community. These are bridged to each other (so you can interact with people using matrix from discord and vice versa.

founded 11 months ago
ADMINS