Skip to content

Instantly share code, notes, and snippets.

View Kuri-su's full-sized avatar
❄️
DeepIn && Focus

Kurisu_Amatist Kuri-su

❄️
DeepIn && Focus
View GitHub Profile
https://developer.github.com/v4/guides/migrating-from-rest/
@Kuri-su
Kuri-su / gist:e8257b411f52147a06dc270d2df51684
Created November 26, 2017 11:16 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Kuri-su
Kuri-su / XSS
Last active December 13, 2017 08:29
![](x"/**/onerror="alert('xss!!!')")
github是采用存入的时候,对特殊符号进行转义,从而无效掉
e.g.
<p><a href="/Kuri-su/Some-classic-algorithms/blob/master/x%22/**/onerror=%22alert('xss!!!')%22" target="_blank"><img src="/Kuri-su/Some-classic-algorithms/raw/master/x%22/**/onerror=%22alert('xss!!!')%22" alt="sdsdssdsd" style="max-width:100%;"></a></p>
也可以采用markdown转成html后去掉全部的onxxxxxx的方法,例如onload,onerror
./configure \
--prefix=/usr/local/php72 \
--sysconfdir=/etc/php72 \
--with-config-file-path=/etc/php72 \
--with-config-file-scan-dir=/etc/php72/php-fpm.d \
--with-fpm-user=www \
--with-fpm-group=www \
--with-curl \
--with-mhash \
--with-gd \
@Kuri-su
Kuri-su / py 序列(Sequence) 介绍
Created February 4, 2018 16:53
py 序列(Sequence) 介绍
序列的主要功能是资格测试(Membership Test)(也就是 in 与 not in 表达式)和索引操作(Indexing Operations),它们能够允许我们直接获取序列中的特定项目。
上面所提到的序列的三种形态——列表、元组与字符串,同样拥有一种切片(Slicing)运算符,它能够允许我们序列中的某段切片——也就是序列之中的一部分。
@Kuri-su
Kuri-su / gist:0566db67363ff42a14cc1278146d9c5f
Created July 2, 2018 09:10
Lists of Throwable and Exception tree as of 7.2.0
Lists of Throwable and Exception tree as of 7.2.0
Error
ArithmeticError
DivisionByZeroError
AssertionError
ParseError
TypeError
ArgumentCountError
Exception
PHP中什么是异常:
  程序在运行中出现不符合预期的情况,允许发生(你也不想让他出现不正常的情况)但他是一种不正常的情况,按照我们的正常逻辑本不该出的错误,但仍然会出现的错误,属于逻辑和业务流程的错误,而不是编译或者语法上的错误。
  PHP中什么是错误:
  属于php脚本自身的问题,大部分情况是由错误的语法,服务器环境导致,使得编译器无法通过检查,甚至无法运行的情况。warning、notice都是错误,只是他们的级别不同而已,并且错误是不能被try-catch捕获的。
  上面的说法是有前提条件的:
  在PHP中,因为在其他语言中就不能这样下结论了,也就是说异常和错误的说法在不同的语言有不同的说法。在PHP中任何自身的错误或者是非正常的代码都会当做错误对待,并不会以异常的形式抛出,但是也有一些情况会当做异常和错误同时抛出(据说是,我没有找到合适的例子)。也就是说,你想在数据库连接失败的时候自动捕获异常是行不通的,因为这就不是异常,是错误。但是在java中就不一样了,他会把很多和预期不一致的行为当做异常来进行捕获。
  PHP异常处理很鸡肋?
blogGist开头,半角冒号:分割
然后紧接show / unshow
多个文件的话用两条横杠分段
private默认不展示,如果是show的话会展示
@Kuri-su
Kuri-su / satis_config_summary.md
Last active February 12, 2022 22:22
#Composer/satis极速搭建Composer私有源

{"title":"composer/satis 配置文件介绍","type":"blogGist","show":true,"description":"composer/satis 搭建 Composer 私有源(BD)"}

composer/satis 极速搭建 Composer 私有源

前置操作(satis安装)

#这里的 /var/www/packagist.satis.cc 只是举个例子,以自己实际的文件夹为准
git clone https://github.com/composer/satis.git  /var/www/packagist.satis.cc
@Kuri-su
Kuri-su / solid.md
Last active November 2, 2018 08:33
#SOLID

{"title":"面向对象 S.O.L.I.D 基本原则","type":"blogGist","show":true,"description":"S.O.L.I.D 单一职责原则,开放封闭原则,里氏替换原则,依赖倒置原则,接口隔离原则"}

  • S 单一职责原则 (Single-Resposibility Principle)
  • O 开放封闭原则 (Open-Closed Principle)
  • L Liskov 替换原则 (里氏替换原则) (Liskov-Substituion Principle)
  • I 依赖倒置原则 (Dependecy-Inversion Principle)
  • D 接口隔离原则 (Interface-Segregation Principle)

单一职责原则

其核心思想为:一个类,最好只做一件事,只有一个引起它的变化。单一职责原则可以看做是低耦合、高内聚在面向对象原则上的引申,将职责定义为引起变化的原因,以提高内聚性来减少引起变化的原因。职责过多,可能引起它变化的原因就越多,这将导致职责依赖,相互之间就产生影响,从而大大损伤其内聚性和耦合度。通常意义下的单一职责,就是指只有一种单一功能,不要为类实现过多的功能点,以保证实体只有一个引起它变化的原因。