The rainbow sea is mine. Https://blog.flxxyz.com/ Zh-CN The world is not worth it. Fri, 22 May 2020 10:17:00 +0000 Fri, 22 May 2020 10:17:00 +0000 Nginx pan domain name resolution directory Https://blog.flxxyz.com/technology/2020/nginx-wildcard-domain.html Https://blog.flxxyz.com/technology/2020/nginx-wildcard-domain.html Fri, 22 May 2020 10:17:00 +0000 Feng Xiao Xian Server { listen 80; server_ Name ~ (? <subdomain>.+). Example.com $; set $root /wwwroot/$subdomain; if (-d /wwwroot/$subdomain/public) { set $root /wwwroot/$subdomain/public; } root $root;}

What works is Server_ Name In this row, the path passes the path variable according to this line.

> >
Zero Https://blog.flxxyz.com/technology/2020/nginx-wildcard-domain.html#comments Https://blog.flxxyz.com/feed/technology/2020/nginx-wildcard-domain.html
WSL spawn Cmd.exe ENOENT Https://blog.flxxyz.com/technology/2020/wsl-spawn-cmd-enoent.html Https://blog.flxxyz.com/technology/2020/wsl-spawn-cmd-enoent.html Wed, 13 May 2020 13:48:00 +0000 Feng Xiao Xian Today, we found a strange bug with WSL. Should we not call sh directly under WSL?

Use Create React App Create react application, Yarn start Once, output Starting the development server... And then throw out one. Error: spawn Cmd.exe ENOENT I wonder how the WSL is invoked under windows. Cmd.exe What a strange mother!

go Create-react-app Flip down Source code It has implemented an open browser operation. Open Class library judgment Windows It's not just checking. Process.platform Value, incidentally. WSL and Docker The environment is also used as a condition for judgement. The following command is the last source of all evil.

 root of all evils

Fix the two way of bug.

  1. take /mnt/c/Windows/System32 Add the environment variables to WSL so that you can pull up the default browser.
  2. React-scripts/scripts/ Start.js Note out OpenBrowser ( Url.localUrlForBrowser );
> >
Zero Https://blog.flxxyz.com/technology/2020/wsl-spawn-cmd-enoent.html#comments Https://blog.flxxyz.com/feed/technology/2020/wsl-spawn-cmd-enoent.html
Go get system version number Https://blog.flxxyz.com/go/2020/get-system-version-number.html Https://blog.flxxyz.com/go/2020/get-system-version-number.html Wed, 06 May 2020 07:08:00 +0000 Feng Xiao Xian

Gist is a half dead state. He has made an anti generation, and can be used with interest. Https://mirror.flxxyz.com/gist/

> >
Zero Https://blog.flxxyz.com/go/2020/get-system-version-number.html#comments Https://blog.flxxyz.com/feed/go/2020/get-system-version-number.html
Untitled Https://blog.flxxyz.com/chat/2020/unknown.html Https://blog.flxxyz.com/chat/2020/unknown.html Mon, 04 May 2020 12:00:00 +0000 Feng Xiao Xian  20200504_ 184824.jpg

 20200504_ 184921.jpg

 20200504_ 185001.jpg

> >
Zero Https://blog.flxxyz.com/chat/2020/unknown.html#comments Https://blog.flxxyz.com/feed/chat/2020/unknown.html
Docker rm: can't remove XXX: No such file or directory Https://blog.flxxyz.com/docker/2020/backing-filesystem-unknown.html Https://blog.flxxyz.com/docker/2020/backing-filesystem-unknown.html Mon, 20 Apr 2020 06:38:00 +0000 Feng Xiao Xian This is really India bug. A kind of One hundred percent of the errors can not be deleted.

 Rm: can't remove XXX: No such file or directory

It has gone through the docker documents and issue, which seems to be related to the ftype of XFS partition, and can not be solved according to other people's plan. A kind of

In the end, two versions will be completed. Of course, reinstall the system.

> >
Zero Https://blog.flxxyz.com/docker/2020/backing-filesystem-unknown.html#comments Https://blog.flxxyz.com/feed/docker/2020/backing-filesystem-unknown.html
Hello, 2020 Https://blog.flxxyz.com/chat/2020/Happy-New-Year.html Https://blog.flxxyz.com/chat/2020/Happy-New-Year.html Tue, 31 Dec 2019 16:34:00 +0000 Feng Xiao Xian  QQ picture 20200420112354.jpg

> >
Three Https://blog.flxxyz.com/chat/2020/Happy-New-Year.html#comments Https://blog.flxxyz.com/feed/chat/2020/Happy-New-Year.html
Coo, a minimalist jQuery implementation. Https://blog.flxxyz.com/js/2019/simple-jquery.html Https://blog.flxxyz.com/js/2019/simple-jquery.html Tue, 06 Aug 2019 09:42:00 +0000 Feng Xiao Xian Today, just an old friend chatted up the jQuery source code. He didn't understand the source code. I had a learning and communication attitude and explained the core realization to him. (as if he had been pigeon for a long time).

By the way, which CDN service provider is looking for a jQuery file to open? The 1.2.3 version I use here is for example. The latest version is almost the same, with only two or three changes. Https://cdnjs.cloudflare.com/ajax/libs/jquery/1.2.3/jquery.js

Source code analysis

17-20 elements Pass the selector and return the init method of your own new. It is estimated that you haven't used it either. $() The second parameter is omitted here.

 Var jQuery = Window.jQuery = function (selector) {
return NEW JQuery.prototype.init (selector);}

26-27 elements This is why it is always a global variable to mount to a window object because of the beginning of $.

 / / Map the jQuery namespace to the '$' one
window.$= jQuery;

36-547 elements Eliminate the core of retention that we do not need. Init Method, the jQuery instance and the selector are judged internally. Here we ignore and simplify.

 JQuery.fn = JQuery.prototype = {
init: function (selector) {
var nodes = Document.querySelectorAll (selector); 
for (VaR I in nodes) {
this[i] = nodes[i]; 
}
return this;}} / / here omitted one hundred thousand words}

549 elements In the last paragraph, the jQuery prototype chain is passed to the prototype of the init method under the jQuery prototype. Looking back at the new code, it is clear and clear.

 JQuery.prototype.init .prototype = JQuery.prototype ;

Complete implementation

Adding functionality to the jQuery prototype is very close to the first version of jQuery. Here I am a simple implementation. Text () Method

 Var jQuery= function (selector) {
return NEW JQuery.fn.init (selector); JQuery.fn = JQuery.prototype = {
init: function (selector) {
var nodes = Document.querySelectorAll (selector); 
for (VaR I in nodes) {
this[i] = nodes[i]; 
}
return this; Element: function (callback) {
for (VaR I = 0; I <) This.length ; i++) {
callback (this[i]); 
text:}}, 
text: function (content) {
if (content = = ''} content) { This.element (function (node) { Node.innerHTML = content;}) Return content;} else {
return this[0].innerHTML; JQuery.prototype.init .prototype = JQuery.prototype ; 

window.$= jQuery;

End

Actually, the core is not complicated. I like it very much. I think most of my functions are implemented by plug-ins. The ingenious design and convenience of the tools themselves.

On the traditional page production, jQuery used a very comfortable shuttle, but the appearance of MVVM changed the way of thinking. We only need to pay attention to business logic, do not need to manually operate DOM, do not need to pay attention to the synchronization of data status, and ease the project management.

If there are simple needs on a single page, jQuery is still useful, MVVM can only be added trouble.

> >
Five Https://blog.flxxyz.com/js/2019/simple-jquery.html#comments Https://blog.flxxyz.com/feed/js/2019/simple-jquery.html
Wake up is 2076 Https://blog.flxxyz.com/chat/2019/cyberpunk-2077.html Https://blog.flxxyz.com/chat/2019/cyberpunk-2077.html Thu, 13 Jun 2019 06:45:00 +0000 Feng Xiao Xian  Cyberpunk-2077.jpg

GOG startup, pre order!

> >
Seven Https://blog.flxxyz.com/chat/2019/cyberpunk-2077.html#comments Https://blog.flxxyz.com/feed/chat/2019/cyberpunk-2077.html
The second generation site update plan Https://blog.flxxyz.com/chat/2019/second-generation-site-update-plan.html Https://blog.flxxyz.com/chat/2019/second-generation-site-update-plan.html Tue, 11 Jun 2019 12:47:00 +0000 Feng Xiao Xian Quick deployment of multi site environments, based on docker, docker-compose layout is easy to add directly, and each site independently uses a FPM instance to perform better.

Link: Flxxyz/fast-deploy-website


I feel so good lately.

TX Hongkong is like a bomb? Since the record is still considered to move into the domestic 8

The old version of the pagoda, which is used before the panel, is still in use. It plans to backup the site and reset the server. A few days ago, it used docker to configure instances in the house virtualization device.

> >
Five Https://blog.flxxyz.com/chat/2019/second-generation-site-update-plan.html#comments Https://blog.flxxyz.com/feed/chat/2019/second-generation-site-update-plan.html
Naked speech for one month Https://blog.flxxyz.com/chat/2019/naked-for-a-month.html Https://blog.flxxyz.com/chat/2019/naked-for-a-month.html Mon, 03 Jun 2019 11:56:00 +0000 Feng Xiao Xian After reading the last article, two months ago, wow, I spent more than a month at home.

What do you want to do at home? Sleep, play games, watch movies, write code, read books, participate in activities, spell models, pick up trash, exercise properly, and organize your room.

The approximate time allocation is as follows
 QQ screenshot 20190603202936.png

Look at millet Bracelet every day almost 10 hours of sleep time, steam collectors game to buy and play? Of course, it's a game of hand games. Wild and Wild games are simple and fast. It's really good. Fixed four map scenes, and a map of activities. Fixed map play can be launched in the time period. New activities will fine tune the scene objects, add some specific playing methods, and the reward mechanism of the team is also very clever. Unless you are the countdown of 123, there will be rewards. Competition is similar to qualifying. Victory will win trophies (individual heroes and trophies). The total trophy will only accumulate all the time. Failure will only reduce individual personal trophies, and it will be poisonous for a long time.

To write code is to optimize things that have been written before, and to achieve new ideas is actually fishing.

The book is indeed looking. Some time ago, he went to participate in the openresty technology sharing meeting of the cloud organization, and got a commemorative shirt and a book. Do it yourself to achieve Lua. A rough look at the following is the use of golang to achieve Lua virtual machine, syntax tree, compiler, temporarily put down the algorithm, but saw last year's purchase has not yet opened Kaifeng??

The other time spent watching movies is the most time spent. I saw the box office dismal of the good movies during the women's Federation, and the selling of the sand sculptures, I couldn't help thinking of Feng Dao.

There are so many garbage movies because there are lots of garbage audiences.

In addition, the art films in April and May are really pretty. (the cry of inner OS), the list of the whole days is coming out.

All of a sudden, I entered the pit to collect garbage and wool, and now I am calm down.

The proper exercise is actually 50 push ups, 50 squats, 20 sit ups.

Two sets of shelves were made, and all the servers, books and hands that were scattered before were put together.
 QQ picture 20190603214043.jpg

Movie list

  • Avenger League 4
  • When prayer ends A very Japanese suspense scenario.
  • "Kill a sheep" Tibetan films, lots of fixed shots, not too many dialogues, thinking through the behavior of characters, what is good and what is evil?
  • Snowstorm There will also be differences in the bad guys, killing each other, the outlaws of all kinds, and the "evil" of ordinary people.
  • "Rome" The black-and-white movie is located in the Rome District of Mexico. The perspective is carried out through the maids. Two of the employers and their wives are cheating. The maid is also suffering from the slag man.
  • Revenge of a mother
  • Penguin Road Actually, it's absurd to see it, but there's a sense of violation in the middle. But what's really more like the animation world? (PS: I want to fly with my big sister).
  • May sky life Co., Ltd. Two brushes
  • Detective Khan Feeling of love
  • Godzilla 2 It's finished.
> >
Eight Https://blog.flxxyz.com/chat/2019/naked-for-a-month.html#comments Https://blog.flxxyz.com/feed/chat/2019/naked-for-a-month.html