Laravel Composer automatic loading mechanism

outline PHP autoloading function 1.1 Origin of PHP autoloading function 1.2 PHP autoload function u autoload() Problems with 1.3 u autoload() Function 1.4 SPL Autoload PSR Specification The automatic loading process of comoposer composer source analysis 4.1 Startup 4.2 Composer autoload file 1, PHP autoloading function 1.1 Origin o ...

Added by Dolemite50 on Sat, 14 Dec 2019 10:54:58 +0200

One-line command for mysql to go struct

Githubd address Chinese Documents | DOCUMENT okcli can generate the specified data table as a corresponding model file and currently supports bringing column names, data types, default values, comments into the specified model.Like the following files: import "time" type ( Student struct { Id int32 `db:"id"` N ...

Added by blacksmoke26 on Sat, 14 Dec 2019 03:10:29 +0200

Record the openId and token obtained by wechat (java implementation)

I've been writing wechat related interfaces recently. I'm really.... hey First write a url request tool class import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public static String sendGet(String url, String charset, int timeout) { String result = ""; try { URL u = ...

Added by shaunrigby on Fri, 13 Dec 2019 21:14:44 +0200

Challenge the routine -- why shouldn't Jsonp be used for cross domain

General cross domain approach Common cross domain methods include: Add access control allow origin Background server agent Jsonp 1. 2. Both methods are safe and reliable. 3. They are not safe and reliable The essence of Json The essence of Json is to reference and execute external JavaScript script. The principle is that the < script > ...

Added by txhoyt on Thu, 12 Dec 2019 21:37:27 +0200

Axios GET cannot set content type

<p>Recently, in the project docking with the backend, the interface tool uses the < code > Axios < / code > thing. Anyway, there are many pits. In the back-end request, set < code > get < / code > request, set < code > content type < / code > in &lt ...

Added by Buffas on Wed, 11 Dec 2019 05:31:02 +0200

javascript object deep copy

The object copies of native js are all shallow copies. If you need deep copies, you need to do some manual operations Using json to serialize and deserialize Example: let obj = { name: 'lizitao', msg: { age: '2' } }; let cp = JSON.parse(JSON.stringify(obj)); console.log(cp); Advantage: very simple to writeDisadvantage: too m ...

Added by wyvern on Mon, 09 Dec 2019 21:29:09 +0200

A simple tool library: jeasy

A year ago, it was found that there was a large use of money in working projects, but only the most basic format function was used. The volume of money directly causes the volume of the project to increase exponentially, and therefore, jeasy is born.jeasy implements the most commonly used function of money, and GridManager Some of the tool meth ...

Added by bobbythenewb on Mon, 09 Dec 2019 18:03:07 +0200

tcp protocol and packet sticking in network programming

tcp protocol and socket in network programming I. single supplement Several ways to realize single column #Mode 1: classmethod # class Singleton: # # __instance = None # # @classmethod # def singleton(cls): # # if not cls.__instance: # cls.__instance = cls() # # return cls.__instance # # obj1 = Singlet ...

Added by nawhaley2265 on Mon, 09 Dec 2019 16:12:26 +0200

Native JS encapsulates ajax and request

First, encapsulate the native xhr as an ajax class xhr and usage see previous articles 1. Determine the request header and other information according to the url. var _headerConfig = {}; if(url.indexOf('getcaptcha') !== -1) { _headerConfig = { Accept: 'image/png', responseType: 'arraybuffer', } ...

Added by Xyn1407 on Mon, 09 Dec 2019 11:45:05 +0200

[Developing on Nervos CKB] Introduction to Nervos CKB scripting [5]: Debugging debug

Author: Xuejie Original Link: https://xuejie.space/2019_10_18_introduction_to_ckb_script_programming_debugging/ Introduction to Nervos CKB scripting [5]: Debugging debug In fact, CKB scripting works at a much lower level than other smart contracts, so the debugging process for CKB is fairly mysterious.In this article, we will show you how to d ...

Added by Michiel on Mon, 09 Dec 2019 05:23:47 +0200