npm list -g --depth=0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class AbstractStep | |
{ | |
protected $successor; | |
protected $shouldPassToSuccessor = true; | |
public static function registerSteps(array $steps): AbstractStep | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//disable execution time limit when downloading a big file. | |
set_time_limit(0); | |
/** @var \League\Flysystem\Filesystem $fs */ | |
$fs = Storage::disk('local')->getDriver(); | |
$fileName = 'bigfile'; | |
$metaData = $fs->getMetadata($fileName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 --> | |
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa --> | |
<head> | |
<!-- 声明文档使用的字符编码 --> | |
<meta charset='utf-8'> | |
<!-- 优先使用 IE 最新版本和 Chrome --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
<!-- 页面描述 --> | |
<meta name="description" content="不超过150个字符"/> | |
<!-- 页面关键词 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts elements divided by newline characters to list items | |
* @param String $text | |
* @param Array $htmlAttrs | |
*/ | |
function nl2li($text, array $htmlAttrs = null) { | |
if (!empty($htmlAttrs)) { | |
$attributes = array_walk($htmlAttrs, function($key, $value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// local file that should be send to the client | |
$local_file = 'test-file.zip'; | |
// filename that the user gets as default | |
$download_file = 'your-download-name.zip'; | |
// set the download rate limit (=> 20,5 kb/s) | |
$download_rate = 20.5; | |
if(file_exists($local_file) && is_file($local_file)) { | |
// send headers |