Skip to main content

Posts

CSS - Code working in npm run start but not npm run build

My code is simply trying to rotate the hamburger menu on open. I have JS that toggles open class on button click. Which works fine. But this particular CSS (SCSS) code doesn't get compiled on npm run build (NODE_ENV=production webpack --mode=production). This works fine running npm start (NODE_ENV=development webpack serve --mode development). I am using SCSS, Tailwind and vanilla JS. I have added other SCSS in the same file and tested the JS which is also fine. What can I do to debug this issue? The CSS seems valid to me .open .hamburger__top-bun { transform: rotate(45deg); } .open .hamburger__bottom-bun { transform: rotate(-45deg); } HTML <button data-behaviour="navToggle" id="menuBtn" class="z-100 hamburger flex justify-center items-center lg:hidden focus:outline-none" type="button"> <span class="hamburger__top-bun"></span> <span class="hamburger__bottom-bun"></span> </but

Can a javascript class return another class?

Is it a bad practice to return a class inside the method of another class? Example: createBlockClass method class BlockBuilder { constructor (methodForBlock) { this.methodForBlock = methodForBlock; }; createBlockClass () { const method = this.methodForBlock.bind(this.methodForBlock); return class Block { constructor(title) { this.title = title; }; method = method; } } }; const blockBuilder = new BlockBuilder(() => console.log('Hello, world!!!')); const Block = blockBuilder.createBlockClass(); const block1 = new Block("block one"); const block2 = new Block("block two"); block1.method(); block2.method(); I need to receive a method as a parameter and add it to the block class before creating any instance Via Active questions tagged javascript - Stack Overflow https://ift.tt/grMIEFY

How could I find the Sender Department in Microsoft Outlook using win32com in Python?

I am programming a script to return each person - along with their department - that was a part of a thread in my Junk folder. As of now I have managed to correctly return their names, however despite trying multiple different methods, I have been unable to access the Departments property. Here is an example of what I am currently working with: import win32com.client output_dir = Path.cwd() / "Output" output_dir.mkdir(parents=True, exist_ok=True) outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") gal = outlook.Session.GetGlobalAddressList() entries = gal.AddressEntries inbox = outlook.GetDefaultFolder(23) messages = inbox.Items num = 0 for message in messages: author = message.SenderName recipient = outlook.CreateRecipient(f"{message.SenderEmailAddress.partition('-')[2]}@placeholder.com") recipient.Resolve() target_folder = output_dir / str(num) target_folder.mkdir(parents=T

How do I open the main window and all the other Windows remain hidden untill called?

I have a bunch of Tk() throughout my program. So when I first run main all these other windows come on to the screen and I have to minimize them to get the main window on front. How do I prevent these windows from opening and just open the main window? There are 3 or 4 .py files imported by the main. I've tried withdraw() , iconify() , tkraise() most of the windows are widgets with frames on them as many as 5 on some. source https://stackoverflow.com/questions/74494090/how-do-i-open-the-main-window-and-all-the-other-windows-remain-hidden-untill-cal

How to have data from neighboring cell removed when checkbox is unchecked?

I want to preface this with the fact that I had help setting up the initial code for the sheet, as I do not have training in this arena of expertise. I have my sheet set up so that I have check boxes in Column A and C with time stamps going into B and D, but I would also like it so that if a check box needs to be unchecked that data is removed. A B C D check box | Time stamp | Check Box | Time Stamp I have the below, but I am not sure where to go from here to actually have the data in B or D be removed if A or C is unchecked. I am not sure what is correct to put in the deleting portion any help is so so so greatly appreciated! function myFunction() { // get the active sheet so you can check if the checkbox in the current cell is checked // get the selected cell on the sheet // get the coordinates of the cell to write the date/time to var activeSheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var activeCell = activeSheet.getCu

How do i loop trough list and add a superscript to paragraph in JQuery

I'm new to JQuery i'm reading a book and i'm following the examples but i got stuck trying this: $(document).ready(function () { var $notes = $('<ol id="notes"></ol>').insertAfter('#hexagon'); $('span.footnote').each(function (index) { $('<sup>' + (index + 1) + '</sup>').insertAfter('.footer'); $(this).appendTo($notes).wrap('<li></li>'); }); }); the Html is this: <div class="cell"> <h1 id="f-title">Flatland: A Romance of Many Dimensions</h1> <div id="f-author">by Edwin A. Abbott</div> <h2>Part 1, Section 3</h2> <h3 id="f-subtitle">Concerning the Inhabitants of Flatland</h3> </div> <div id="excerpt" class="cell">an excerpt</div> <div class="chapter cell&quo

Instagram Web automation Python

I want to select a specific message in instagram DM's and then click the 3 dots on the messages and then click like, but the class name for the 3 dots and the like button isn't unique. How could I click on the 3 dots and then on the like button? I've tried selecting the DM's but they also have a non-unique class name. This is the html of those buttons: <div class="_ac72" role="listbox" tabindex="0"> <div class="xdt5ytf x78zum5"> <div class=" _acd3"> <div class="_acqt _acqu" role="listbox" tabindex="0"> <div class=" _ac1n"><div class=" _ac1r _ac1w"> <div role="button" class="_aa06" tabindex="-1"> <div class="_ab8w _ab94 _ab99 _ab9h _ab9m _ab9p _ab9- _abaa _abcm" style="min-height: 44px;"> <div class="_aacl _aaco _aacu _aacx _aad9 _aadf"> <div class="