Koa - Upload files using koa-multer (upload restrictions, error handling)

Preface Uploading files is a very common operation in development. Today I choose to use koa-multer middleware to achieve this function. In addition to uploading files, I will also restrict file upload and handle upload errors. Since the original koa-multer has stopped maintenance, we need to use the latest @koa/multer. This module is a branc ...

Posted by Penelope on Sun, 01 Sep 2019 03:41:19 -0700

Using "cross-observer" as a baby, it is easy to realize lazy loading, top suction and bottom touching.

Let's first look at the introduction in MDN: The Intersection Observer interface provides an asynchronous way to observe the intersection state of the target element with its ancestor element or top-level document viewport, which is called root. Directly into the topic, Intersection Observer translates as "cross-observer". Its task is ...

Posted by Popple3 on Wed, 28 Aug 2019 04:21:27 -0700

CSS (display and hide, overflow)

Display and Hide, Overflow Knowledge Point 1.visibility Display and Hide Sets or retrieves whether to display an object. Unlike the display attribute, this attribute preserves the physical space occupied by the hidden object. This means that elem ...

Posted by nishanthc12 on Mon, 26 Aug 2019 02:17:25 -0700

Go golang Micro Services Framework go-micro Getting Started Notes 2.1 micro Tool micro api

micro api The microfunction is very powerful, and this article will elaborate on the capabilities of the micro api command line Say important things three times The full code for this article is https://idea.techidea8.com/open/idea.shtml?id=6 The full code for this article is https://idea.techidea8.com/open/idea.shtml?id=6 The full code for t ...

Posted by runestation on Sat, 24 Aug 2019 17:50:17 -0700

Learning regular expressions through examples

Determine if your mailbox is correct Mailbox Regular /\w+[\w\.]*@[\w\.]+\.\w+/ test case const regex = /\w+[\w\.]*@[\w\.]+\.\w+/ regex.test('666@email.com') // true regex.test('july@e.c') // true regex.test('_@email.com.cn') // true regex.test('july_1234@email.com') // true regex.test(' ...

Posted by SFDonovan on Fri, 23 Aug 2019 20:08:20 -0700

Cascade query of regional information based on layUI invoking background data

Implementing cascaded query of regional information by calling background data based on layUI 1. Basic Ideas Background provides a common interface for querying region lists based on region coding Page Initialization Calls Background Interface to Load All Provinces Click on the province to send the province area code to the background to q ...

Posted by yaba on Fri, 23 Aug 2019 02:42:26 -0700

python front-end development (jQuery events, animation effects,.each(),.data())

11.58 Event 11.581 Event Binding Method and Unbinding Binding events: // Binding mode 1: $('.box1').click(function () { alert('Binding Mode I') }); ​ // Binding mode 2: $('.box1').on("click",function () { alert('Binding Mode I') }); ​ // Binding mode 3: $('.box1').bind('click',{'a':'b'} function (e) { alert('Binding ...

Posted by phpQuestioner on Wed, 21 Aug 2019 07:51:06 -0700

JavaScript Event Complementation - Make your own stand-alone webpage album

Just a little change, there's a stand-alone photo album of its own. Modify to your own album -- Modify the data in data.js Look at pictures -- just a little special effects Classified Pictures - Select Types Search for pictures - enter keywor ...

Posted by [/Darthus] on Mon, 19 Aug 2019 05:41:49 -0700

Deep Understanding Go-Memory Allocation

Go language built-in runtime (runtime), abandoned the traditional way of memory allocation, changed to autonomous management, initially based on tcmalloc, although the later changes are relatively large. Using autonomous management can achieve better memory usage patterns, such as memory pools, pre-allocation, etc., thus avoiding the performanc ...

Posted by neon on Thu, 15 Aug 2019 06:11:13 -0700

The difference between mouseover mouse moving in, mouseout mouse moving out and mouseseenter mouse moving in and mouseleave mouse moving out

Moseover Implements Mouse Move-in Effect The code is as follows: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> ...

Posted by lurius on Sat, 10 Aug 2019 07:31:07 -0700