In input only numbers on js
A simple JS script, filtering input information in input. Enter only numbers.
When running Gulp with code like this:
gulp.task('default', ['watch']);
gulp.task('watch', ['css', 'js'], function () {
gulp.watch(scssSrc, ['css']);
gulp.watch(jsSrc, ['js']);
gulp.watch(svgSpriteSrc + "**/*.svg", ['svg']);
});
gulp.task('css', function () { /*и т.д. */}
gulp.task('js', function () { /*и т.д. */}
gulp.task('svg', function () { /*и т.д. */}
An error may occur that prevents the process from starting:
When running in the background, the dynamic collection of saved data in Ubuntu 18.04 is set to max_user_watches .
The fact is that the fs.inotify.max_user_watches parameter in /etc/sysctl.conf is responsible for simultaneously reading a certain number of files. When it reaches its limit, gulp's work is terminated.
Found the cure
echo fs.inotify.max_user_watches=131072 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
As a result, by increasing the number of simultaneously viewed files, we achieve the work of Gulp.
Don't go overboard with max_user_watches.
A simple JS script, filtering input information in input. Enter only numbers.
Let's consider how to move a block in the mobile version if it is located in a different place in the desktop version. Let's use JQuery.
When describing minimal codes that have a syntax similar to C++, it may be necessary to have minimal highlighting on the site for better readability. I will give the easiest way to highlight, which I took from habrahabr. Consider, connect, describe ...