Back
Learning to code

Learning to code

#code

Trying to find fast and enjoyable framework to ship web apps
#code make a script that will collect emails from fastmail and scroll down automatically: const emailData = []; (async () => { const scrollContainer = document.querySelector('ul.u-list-body.v-Mailbox'); if (!scrollContainer) { console.error('Unable to find the scroll container.'); return; } const processedItems = new Set(); let previousItemCount = 0; // Utility function to delay execution function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } while (true) { let liElements = document.querySelectorAll('li.v-MailboxItem'); // Process any new li elements for (const li of liElements) { // Use a unique key. If 'id' is stable and unique, keep it. // Otherwise, consider using something like li.querySelector('.v-MailboxItem-link').href or subject text. const uniqueKey = li.id || li.querySelector('a.v-MailboxItem-link')?.href; if (!uniqueKey) continue; // If we can't find a stable key, skip. if (!processedItems.has(uniqueKey)) { processedItems.add(uniqueKey); // Simulate the action of viewing the email to get the "v-Message-toName" li.click(); await wait(1000); // Wait longer to ensure the email content is loaded const span = document.querySelector('span.v-Message-toName'); if (span) { emailData.push(span.textContent.trim()); } else { console.warn(`No "v-Message-toName" found for item with unique key: ${uniqueKey}`); } // (Optional) Close the opened message or go back if needed. // document.querySelector('button.back-button')?.click(); // await wait(500); } } // Check if we got more items after processing liElements = document.querySelectorAll('li.v-MailboxItem'); const currentItemCount = liElements.length; // If no new items have appeared after processing the currently visible ones, we try scrolling if (currentItemCount > previousItemCount) { previousItemCount = currentItemCount; } else { // Try to scroll further to load more items // Scroll to the bottom of the container scrollContainer.scrollTop = scrollContainer.scrollHeight; await wait(2000); // Check again if new items appeared liElements = document.querySelectorAll('li.v-MailboxItem'); if (liElements.length <= previousItemCount) { // No new items after scrolling break; } else { previousItemCount = liElements.length; } } } console.log('Collected Emails:', emailData); })();
See similar todos

No replies yet

#code crash chat gpt on macOS. it doesn’t open anymore. F
See similar todos

No replies yet

#code try ChatGPT macOS with VSCode and Terminal
See similar todos

No replies yet

Switched from Postmark to Mailtrap.io to sending ~1M emails per month, cuz cheaper and better stats design + the team helped to improve open / bounce rates #code
See similar todos

No replies yet

#code discover that mcdonalds has cool animation on buttons hover (different every time)
See similar todos

No replies yet

#code create a pull request to openai ruby gem about how to use transcribe method with ruby on rails and active storage, cuz I spent an hour trying to figure it out, until @marc told me how to do it github.com/alexrudall/ruby-op…
See similar todos

No replies yet

open source my own twitter method to post tweets via code, cuz all existing gems are too complex github.com/AndreyAzimov/twitt… #code
See similar todos

No replies yet

learn how to run 2 rails apps on local host on different ports PORT=4000 rails s #code
See similar todos

No replies yet

#code make first Ruby mini open source project github.com/AndreyAzimov/ruby-…
See similar todos
#code become ruby pro and write something like @marckohlbrugge would wrote
See similar todos
#code get codepilot invite
See similar todos

No replies yet

create my own rails #code snippets in sublime like I had in php
See similar todos

No replies yet

Become Ruby on Rails contributor by adding Bootstrap to it twitter.com/dhh/status/143626… #code
See similar todos
add all terminal aliases so I don’t need to type it over and over again #code
See similar todos

No replies yet

#code install elixir and phoenix
See similar todos

No replies yet

#code create basic ruby on rails crud app using scaffolding, bootstrap and faker
See similar todos

No replies yet

#code complete just JustJavascript.com course by @dan_abramov
See similar todos

No replies yet

#code fix sitemap package installation via yarn. thanks @Necmttn solution: use yarn
See similar todos

No replies yet

#code install sitemap npm package #code www.npmjs.com/package/next-si…
See similar todos

No replies yet

#code install react with next.js and make it run with a blog template on mdx vercel.com/new/clone?demo-des…
See similar todos

No replies yet