Lenix

What does +new Date() mean

js uses ‘+’ before a data type. The purpose of this operation is to convert the data type to Number type. If the conversion fails, it will return NaN; E.g: + ‘2’ + 1 // 3 + [ 1 ] // NaN +new Date() will call the valueOf method on Date.prototype, according to new Date().getTime() […]

What does +new Date() mean Read More »

nginx enables proxy cache proxy cache

nginx enables proxy cache proxy cache in nginx.conf http { add below proxy_cache_path /data/nginxcache levels=1:2 keys_zone=my_cache:500m max_size=10g inactive=30d use_temp_path=off; Add the following configuration to the configuration file of a site: location / { proxy_cache my_cache; proxy_cache_revalidate on; #proxy_cache_valid 200 206 304 301 302 30d; proxy_cache_valid any 30d; proxy_ignore_headers “Set-Cookie”; proxy_ignore_headers “Expires”; #proxy_ignore_headers “Age”; proxy_cache_key… The

nginx enables proxy cache proxy cache Read More »

How to force restart after ubuntu (linux) system crashes (no response).

How to force restart after ubuntu (linux) system crashes: Press Alt+SysRq+B to force restart. Some computers need to press the Fn key, that is, Fn+Alt+SysRq+B . Note: The sysrq key is generally the same as the prtsc (print screen) key. If your pressing Fn+Alt+SysRq+B doesn’t work, do the following: First press Fn+Alt+SysRq+B, Hold Alt, release

How to force restart after ubuntu (linux) system crashes (no response). Read More »

The whole process of Gatsby static website construction (1)—installation and construction

Gatsby Gatsby is a lightning-fast, modern site generator built for React – static sites. Install Gatsby CLI npm install -g gatsby-cli Build the production version gatsby build For more information, please refer to https://ift.tt/npIhfFw … The post Gatsby Static Website Building Process (1)—Installation and Building first appeared on Lenix Blog . This article is reprinted

The whole process of Gatsby static website construction (1)—installation and construction Read More »

How to read cookies in JavaScript

read cookies The content of the cookie can be read directly through document.cookie: var strCookie = document . cookie ;  At this point, strCookie is a string consisting of the name/value pairs of all cookies under the domain name, and the name/value pairs are separated by “semicolon and space”. For easy viewing, you can use

How to read cookies in JavaScript Read More »

return in ajax does not take effect

Writing return directly in ajax in the function addSglr() method does not take effect; Because it returns the success method in ajax, not addSglr(). Therefore, a global variable can be set for judgment to achieve the effect of stopping. Note: Ajax must be synchronous. function addSglr(){ var flag = false;//Global variable for the following judgment

return in ajax does not take effect Read More »

css force no line break

In CSS, no line breaks are enforced, the text will not wrap, and the text will continue on the same line until it encounters a br tag. white-space:nowrap; … The post css forcing no line breaks first appeared on Lenix Blog . This article is reprinted from https://blog.p2hp.com/archives/9189 This site is for inclusion only, and

css force no line break Read More »