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\Providers; | |
| use App\Models\AdminLog; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Event; | |
| use Illuminate\Support\ServiceProvider; | |
| class LogServiceProvider extends ServiceProvider |
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
| class PyTrieNode(object): | |
| def __init__(self, key="", seq=[]): | |
| self.key = key | |
| self.end = len(seq) == 0 | |
| self.children = {} | |
| if len(seq) > 0: | |
| self.children[seq[0]] = PyTrieNode(seq[0], seq[1:]) | |
| def add(self, seq): | |
| if len(seq) == 0: |
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
| let regex; | |
| /* 匹配特定的字符串 */ | |
| regex = /hello/; // 查找斜杠中的字符串(大小写敏感)……匹配 "hello", "hello123", "123hello123", "123hello",但不匹配 "hell0", "Hello" | |
| regex = /hello/i; // 查找斜杠中的字符串(大小写不敏感)……匹配 "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // 全局查找斜杠中的字符串…… | |
| /* 通配符 */ | |
| regex = /h.llo/; // "." 匹配除了换行外的任何一个字符……匹配 "hello", "hallo",但不匹配 "h\nllo" | |
| regex = /h.*llo/; // "*" 匹配任何字符零次或多次,如 "hello", "heeeeeello", "hllo", "hwarwareallo" |
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 | |
| // source version: https://github.com/JetBrains/phpstorm-stubs/blob/master/redis/Redis.phpdis/Redis.php | |
| // phpdoc version: https://github.com/nrk/predis/blob/v1.1/src/ClientInterface.php | |
| // save this file to your project root | |
| namespace { | |
| exit("This file should not be included, only analyzed by your IDE"); | |
| /** |
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
| # 生成 dhparam.pem 文件, 在命令行执行任一方法: | |
| # 方法1: 很慢 | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
| # 方法2: 较快 | |
| # 与方法1无明显区别. 2048位也足够用, 4096更强 | |
| openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096 |
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
| <!doctype> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <?php | |
| require_once "Classes/PHPExcel.php"; | |
| $tmpfname = "test.xlsx"; |
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
| __author__ = 'ZhangJian' | |
| import requests | |
| import time | |
| import sys | |
| import os | |
| import log | |
| from bs4 import BeautifulSoup | |
| from subprocess import Popen |
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
| # Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one... | |
| php -dxdebug.remote_autostart artisan | |
| #Running phpcs for 5.3: | |
| phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* . |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |