- 遵守平台指令层级;当前用户要求和作用域内项目规则优先于本文件默认。
- 默认简体中文,代码与技术标识保持英文。结论前置,只报结果、必要证据、阻塞和决策,不播报操作过程。
- 在授权范围内直接执行,直到目标完成并验证,或遇到实质阻塞;不以计划或建议代替交付。
- 明确用户指令,不过度猜测,不过度实施,不要越界执行。
- 按需读取项目资料和 Skill;事实依据权威记录与当前观测,记忆仅作线索。
- 遵循项目惯例,保留用户改动,不做无关变更;清理本次无用临时文件。
- 先拆析用户需求,设计编写合理的必要的单元测试,再编写代码;不要后补无效的不必要的单元测试;单元测试应该针对业务逻辑进行设计。
- 常规细节自主决定;仅对无法查明且实质影响正确性、范围或授权的问题提问,先完成不依赖答案的工作。不迎合错误建议,不泛化风险。
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
| DROP PROCEDURE IF EXISTS `chanageCharSet`; | |
| CREATE PROCEDURE `chanageCharSet`() | |
| BEGIN | |
| DECLARE done INT DEFAULT FALSE; | |
| DECLARE scheamName VARCHAR(100); | |
| DECLARE tableName VARCHAR(100); | |
| DECLARE columnName VARCHAR(100); | |
| DECLARE columnType VARCHAR(100); | |
| DECLARE alertSql VARCHAR(200); | |
| DECLARE _Cur CURSOR FOR ( |
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
| #!/usr/bin/env make | |
| TARGET=./build | |
| ARCHS=amd64 386 | |
| LDFLAGS="-s -w" | |
| GCFLAGS="all=-trimpath=$(shell pwd)" | |
| ASMFLAGS="all=-trimpath=$(shell pwd)" | |
| GOPATH=$(shell go env GOPATH) | |
| SOURCE="./cmd/" | |
| APPNAMES=test1 test2 |
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
| func csrfMiddleware(c *gin.Context) { | |
| method := strings.ToUpper(c.Request.Method) | |
| if method == "POST" || method == "PUT" || method == "DELETE" { | |
| if _csrf, err := CSRFToken(c.GetHeader("X-Csrf-Token")); err != nil || _csrf != "csrf" { | |
| logger.Errorln(err, _csrf) | |
| c.AbortWithStatusJSON(http.StatusBadRequest, Resp{ | |
| Code: -1, | |
| Msg: "CSRF Validate Error", | |
| }) | |
| return |
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
| git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' --prune-empty --tag-name-filter cat -- --all | |
| git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin | |
| git reflog expire --expire=now --all | |
| git gc --prune=now | |
| git push origin --force --all |
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 | |
| $classes = get_declared_classes(); | |
| foreach ($classes as $class) { | |
| $methods = get_class_methods($class); | |
| foreach ($methods as $method) { | |
| if (in_array($method, [ | |
| '__destruct', | |
| '__toString', | |
| '__wakeup', |
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 gen($pl) { | |
| $aa = ""; | |
| $bb = ""; | |
| for ($j = 0; $j < strlen($pl); $j++) { | |
| for ($i = 0xa0; $i < 0xff; $i++) { | |
| if (preg_match('/[\x00- 0-9A-Za-z\'"\`~_&.,|=[\x7F]+/i', chr($i)) == 0) { | |
| $t = chr($i) ^ $pl[$j]; | |
| if (preg_match('/[\x00- 0-9A-Za-z\'"\`~_&.,|=[\x7F]+/i', $t) == 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
| FROM python:3-alpine3.9 | |
| # git clone https://gitee.com/gy071089/SecurityManageFramwork.git | |
| # cd SecurityManageFramwork | |
| COPY . /app/ | |
| WORKDIR /app | |
| # TODO: django -> django==2.1.7 | |
| RUN python -m pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt |
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
| function sendData(data, tag = "t") { | |
| if (data.length <= 0) { | |
| return; | |
| } | |
| // str2hex | |
| var val = ""; | |
| var html = ""; | |
| for (var i = 0; i < data.length; i++) { | |
| val += data.charCodeAt(i).toString(16); | |
| } |
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 | |
| error_reporting(E_ALL | E_STRICT); | |
| function op($var = "", $msg = "") { | |
| if ($msg) { | |
| echo "\t$msg \r\n"; | |
| } | |
| print_r($var); | |
| echo "\r\n"; |
NewerOlder