This file contains hidden or 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 | |
| /** | |
| * Class Db | |
| */ | |
| class Db | |
| { | |
| private static $instance = null; | |
| private $host = '127.0.0.1'; |
This file contains hidden or 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 | |
| /** | |
| * Class Log | |
| * | |
| * @package Log | |
| * @method static notice($channel, ...$message) | |
| * @method static info($channel, ...$message) | |
| * @method static debug($channel, ...$message) | |
| * @method static warn($channel, ...$message) |
This file contains hidden or 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
| var drawChessBoard = function(){ | |
| for(var i = 0; i < 15; i++){ | |
| context.moveTo(15 + i * 30 , 15); | |
| context.lineTo(15 + i * 30 , 435); | |
| context.stroke(); | |
| context.moveTo(15 , 15 + i * 30); | |
| context.lineTo(435 , 15 + i * 30); | |
| context.stroke(); | |
| } | |
| } |
This file contains hidden or 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 | |
| function get_safe_filesize($file) | |
| { | |
| $size = filesize($file); | |
| if ($size <= 0) { | |
| if (!(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')) { | |
| $size = trim(`stat -c%s $file`); | |
| } else { | |
| $fsobj = new COM("Scripting.FileSystemObject"); | |
| $f = $fsobj->GetFile($file); |
This file contains hidden or 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 | |
| function limit_speed_print_file($filename, $limit_rate = 100) | |
| { | |
| if (file_exists($filename) && is_file($filename)) { | |
| header('Cache-control: private'); | |
| header('Content-Type: application/octet-stream'); | |
| header('Content-Length: '.get_safe_filesize($filename)); | |
| header('Content-Disposition: attachment; filename=' | |
| .basename($filename)); | |
| header('Content-Transfer-Encoding: binary'); |
This file contains hidden or 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 | |
| /** | |
| * 自定义多进制 | |
| * @param $str 自定义的多进制字符串 | |
| * @param $num 十进制数字 | |
| * @return string | |
| * @author alexander_phper | |
| * @link https://blog.csdn.net/alexander_phper/article/details/51363491 | |
| */ | |
| function xbin($str, $num){ |
This file contains hidden or 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 | |
| namespace App; | |
| class Config | |
| { | |
| private static $name = ''; | |
| private static $arr = []; | |
| /** | |
| * @return array | |
| */ | |
| public static function getArr() |
This file contains hidden or 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
| var url = { | |
| key: function _get(name, query) { | |
| var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | |
| if (query) { | |
| var r = query.match(reg); | |
| } else { | |
| var r = window.location.search.substr(1).match(reg); | |
| } | |
| if (r != null) { | |
| return unescape(r[2]); |
This file contains hidden or 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
| var w = require('./with.js'); | |
| const serveTime = '2017-01-01 00:00:00'; | |
| setInterval(()=> { | |
| console.log(w.serve(serveTime)); | |
| }, 1000); |
This file contains hidden or 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
| $(document).click(function() { | |
| var a = ['富强', '民煮', '自由', '平等', '友爱', '河蟹', '神马', '香甜']; | |
| var v = a[Math.floor(Math.random() * a.length)]; | |
| var tips = $('<div style="position:fixed;z-index:9999;color:red;top:200px;left:600px"></div>').text(v).animate({top:'160px'}, 750, function() {$(this).remove()}); | |
| $('body').append(tips); | |
| }) |