nodejs learning notes (1) - web crawler

Unconsciously, I have been developing nodejs for more than a year. I learned a lot in the process and forgot a lot, so I still insist on leaving some content in the blog for later reference. This article mainly realizes a simple website crawler function, grabs the website inside picture as well as the content. Before grabbing, the modules of SU ...

Posted by ubunken on Tue, 31 Mar 2020 23:04:57 -0700

Asynchronous application of Generator in ES6

1, introduction Asynchronous programming is too important for the Javascript language. The execution environment of Javascript language is "single thread". If there is no asynchronous programming, it cannot be used at all. It must be stuck. Now I'll focus on how the Generator function performs asynchronous op ...

Posted by praeses on Tue, 31 Mar 2020 22:29:28 -0700

Some problems about the preparation of JS clone() function

Problem Description: use js to implement a clone() cloning function, which will clone one of the different types of input values Number, String, Undefined, Boolean, Function,Null,Object,Array,RegExp 1, Solution code Post code directly, function clone(obj){ var copy; switch(typeof obj){ case 'undefined':b ...

Posted by kevin99 on Tue, 31 Mar 2020 22:20:05 -0700

JavaScript implementation of polyline Boolean operation

This paper mainly introduces the method of realizing Boolean operation with polylines //Get all the curves after Boolean operation function getOperatedCurves(sourceCurs: Curve[], targetCus: Curve[]) { let source: Polyline | Circle = (sourceCurs[0] instanceof Circle) ? sourceCurs[0] as Circle : new Polyline().Co ...

Posted by dotbands on Tue, 31 Mar 2020 20:56:00 -0700

vue2 learning note 1

Preface It's a bit awkward to see some background management systems can't be implemented by themselves. So I have made up for the front-end knowledge. Choose a vue framework for learning. Here are some learning ideas thinking 1. Learn the properties and methods of Vue objects 2. Learning two-way binding 3. Use of lea ...

Posted by gladiator83x on Tue, 31 Mar 2020 19:09:48 -0700

Zhimeng super simple "load more" and "infinite pull-down" plug-ins, support dynamic and static, support image delay loading

Infinite Ajax Scroll, or ias for short, is a jQuery scrolling ajax paging plug-in. When the page scrolls to the visible part of the container, the data will be loaded asynchronously and automatically. The integration of plug-ins is very simple, including the following steps: 1. jquery.js and jquery-ias.min.js are re ...

Posted by bacarudaguy on Tue, 31 Mar 2020 14:00:12 -0700

nginx profile description

nginx.conf user www www; # Nginx's worker processes run users and user groups worker_processes 4; # Number of startup processes, usually set equal to the number of CPUs #worker_processes auto; #The following parameters specify which cpu is assigned to which process, generally speaking, there is no special specific ...

Posted by lukeurtnowski on Tue, 31 Mar 2020 13:02:36 -0700

React tutorial (2) - jsx syntax, conditional rendering, list rendering

1. JSX syntax In react, the syntax of jsx is used to display DOM elements. The react template of a basic jsx syntax is as follows: <div>{this.props.title}</div> The essence of this approach is: embed js expressions in html!! How does the compiler compile jsx syntax? The rule is as follows: when it comes to parsi ...

Posted by disaster77 on Tue, 31 Mar 2020 11:08:21 -0700

FileReader gets the BASE64 code of the picture and previews it

FileReader gets base64 code of picture and previews it FileReader, to be honest, I'm not familiar with it. It's just a record of usage here. Method name parameter describe abort none Interrupt read readAsBinaryString file(blob) Read file as binary readAsDataURL file(blob) Read file as DataURL readAsText fil ...

Posted by RazorICE on Tue, 31 Mar 2020 09:23:34 -0700

Simple but error prone onclick error reporting

Uncaught TypeError: Cannot set property 'onclick' of null; One sentence: "make sure that dom node rendering of click events is performed before JS!" Solve. A native JS click event written by myself. JS code is written on the home page <script type="text/javascript"> var all_features = document ...

Posted by Dutch MaFia-boy on Tue, 31 Mar 2020 06:56:38 -0700