What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-08-28 01:36:01
[Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL> [Violation] 'setTimeout' handler took 59ms
jQuery.event.special.touchstart = { setup: function( _, ns, handle ) { this.addEventListener('touchstart', handle, { passive: !ns.includes('noPreventDefault') }); } }; jQuery.event.special.touchmove = { setup: function( _, ns, handle )... Add solution -
C++ 2021-08-28 00:58:01
round all columns in R dataframe to 3 digits
round_df <- function(x, digits) { # round all numeric variables # x: data frame # digits: number of digits to round numeric_columns <- sapply(x, mode) == 'numeric' x[numeric_columns] <- round(x[numeric_columns], digits) ... Add solution -
Javascript 2021-08-28 00:24:02
javascript autoscroll
// If you don't know when data comes, you can set an interval: window.setInterval(function() { var elem = document.getElementById('yourDivWithScrollbar'); elem.scrollTop = elem.scrollHeight; }, 5000); // If you do know when data comes, you can do it ... Add solution -
Javascript 2021-08-28 00:09:02
react proptypes
import PropTypes from 'prop-types'; MyComponent.propTypes = { // You can declare that a prop is a specific JS type. By default, these // are all optional. optionalArray: PropTypes.array, optionalBool: PropTypes.bool, optionalFunc: PropTypes.fun... Add solution