Skip to content

Instantly share code, notes, and snippets.

View AshoneA's full-sized avatar
🎯
zzz

zefeng AshoneA

🎯
zzz
  • ByteDance
  • Shanghai
View GitHub Profile
@AshoneA
AshoneA / 11
Created May 7, 2017 09:00
sync setting
db2e18d5501537ea90124b7073e4b4f5906de821
@AshoneA
AshoneA / shallowcompare.js
Created March 17, 2020 10:26
shallowcompare
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
if (ret !== void 0) {
return !!ret;
}
if (objA === objB) {
return true;
}
@AshoneA
AshoneA / gist:29e9a61be4b06baa653776710ba19171
Created April 12, 2020 15:35
Confirm before pushing to Git master branch
#!/bin/bash
# Warn before pushing to protected branches
# Make script executable with chmod +x pre-push
# Bypass with git push --no-verify
BRANCH=`git rev-parse --abbrev-ref HEAD`
PROTECTED_BRANCHES="^(master|dev|release-*|patch-*)"
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]]; then
1803 ngx_int_t
1804 ngx_http_set_etag(ngx_http_request_t *r)
1805 {
1806 ngx_table_elt_t *etag;
1807 ngx_http_core_loc_conf_t *clcf;
1808
1809 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1810
1811 if (!clcf->etag) {
1812 return NGX_OK;