Danh mục: Ngôn Ngữ Lập Trình

Selenium WebDriver & Unit Testing trên Window
Selenium WebDriver hỗ trợ các phương thức can thiệp DOM HTML để thực hiện các thao tác tự động trên trình duyệt. Đối với các tính năng test cơ bản trên web/ blog, Selenium hỗ trợ tester thực hiện các test point, test case kiểm thử các phương thức hoạt động trên site nhằm bảo…

Arrow Function là gì? ưu nhược điểm khi sử dụng?
Trong quá trình viết mã JavaScript hay các framework js như: AngularJS, React, VueJS,… có thể bạn sẽ gặp những hàm khai báo có cấu trúc như sau: FunctionName =()=>{ //TODO: code } Có thể nếu chưa biết bạn sẽ thắc mắc cách khai báo này có tên gọi là gì? Ưu và nhược điểm của…

Sample code for a RESTful API constructed using WordPress
Here’s an example of a RESTful API built with WordPress that implements token-based authentication for the four main HTTP methods (POST, GET, PUT, DELETE): <?php class Sample_REST_API { /** * Endpoint namespace. * * @var string */ protected $namespace = ‘sample/v1’; /** * Route name. * * @var string */ protected $route = ‘/data’; /**…

Sample code in PHP checks the size of a folder by path, then deletes
Sample code in PHP checks the size of a folder by path, then deletes all files when the size reaches the limit specified as a percentage of disk space. Create the PHP script located at /path/to/your/script.php <?php $path = ‘/path/to/cache_folder’; $limit = 90; // percentage of disk space function get_dir_size($path) { $total_size = 0; $files…

Mustache Template với jQuery
Mustache.js là thư viện hỗ trợ lập trình viên giảm thiểu việc xử lý logic trong quá trình hiển thị dữ liệu lên front-end với HTML5, Javascript. Điển hình là dữ liệu có cấu trúc json. Sử dụng Mustache Template giúp code js dễ nhìn, trực quan hơn trong quá trình phát triển giao diện…

How to create a RESTful API with Elasticsearch using the PHP Laravel framework?
Here is an example of how to create a RESTful API with Elasticsearch using the PHP Laravel framework: First, you’ll need to install Elasticsearch on your server, and make sure it’s running. Next, you’ll need to install the Elasticsearch PHP client library by running the following command in your terminal: composer require elasticsearch/elasticsearch In your…

Sử dụng Stopwatch so sánh tốc độ xử lý trong .Net
Test ứng dụng có lẽ là việc không còn xa lạ với lập trình viên, đặc biệt là các tester để xử lý lỗi, so sánh tốc độ xử lý… Việc viết Unit Test có thể không phải lập trình viên nào cũng có thể làm tốt và hiệu quả được, việc viết test sẽ…