Really Good Tips — copy() from console, git bisect and more

Hey there!

In this new edition of the Really Good blog, we will try to bring you weekly tips, tricks, thoughts and pointers for good plugins and tools (and maybe some to avoid). Composed directly out of our daily experiences — we hope it will enrich your Front End skills and it might even save you some time and trouble.

This week’s interesting bits

addEventListener supports a (different) third argument

addEventListener now supports options as the third argument in most browsers (instead of the usual boolean) which adds once &passive flags on top of the existing capture flag.

Notice you need feature detection, otherwise passing the settings object will be considered as capture: true for browsers with no support.

EventTarget.addEventListener()

The EventTarget.addEventListener() method adds the specified EventListener – compatible object to the list of event listeners for the specified event type on the EventTarget on which it is called.

Console API – copy()

Run this in your browser’s console: copy({now: new Date(), title: ‘Dwayne “The Rock” Johnson’}) and then paste anywhere. We find it especially useful for copying objects, as it stringifies JSON by itself (see the result in your clipboard, and don’t bother copying DOM nodes as the circular references prevent serialization).

It’s supported in all modern browsers excluding Edge, and here’s some cool things you can do with it:

You can in Blink/WebKit, anyway. You can’t directly in JavaScript, as I’m sure that’s some security (or good taste) issue that just isn’t allowed. Sites th

git bisect

If your code is broken and you need to find the last good commit, finding your way between dozens or hundreds of commits can be very frustrating. git bisect uses a binary search through your commit history to help you identify the faulty commit.

Something we liked

react-rnd – A resizable and draggable component for React. It wraps separate resizable & draggable components by the same author, the API is clear and well-documented, and it’s reliable as far as we’ve experimented.

bokuweb/react-rnd

bokuweb/react-rnd

react-rnd – 🖱 A resizable and draggable component for React.

 

That’s if for now, thank you for reading. See you next week.

Published by

Team Really Good

Check out our website

Leave a Reply

Your email address will not be published. Required fields are marked *