Skip to content

Instantly share code, notes, and snippets.

View daqi's full-sized avatar
💭
I may be slow to respond.

大齐 daqi

💭
I may be slow to respond.
View GitHub Profile
var trys = 0;
function pageInit(){
var imgW = 695,
imgH = 1033,
wW = window.innerWidth,
wH = window.innerHeight,
_imgW, _imgH,
picbg = document.getElementById('picbg'),
px2rem = function(px){
return px/(imgW/10);

Directional React Animations

This is a demo of dynamic directional transitions using React's CSSTransitionGroup.

A Pen by tgecho on CodePen.

License.

git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
git config --global --unset http.https://github.com.proxy
function navigation(curr, total, min) {
var left = 1;
var right = total;
var leftmin = Math.floor((min - 1) / 2);
var rightmin = (min - 1) % 2 === 0 ? leftmin : leftmin + 1;
var indexs = []
if (total >= min + 1) {
if (curr > leftmin && curr < total - rightmin) {
left = curr - leftmin

Array<T>

Legend:

  • ✏️ method changes this.
  • 🔒 method does not change this.

Array<T>.prototype.*:

  • concat(...items: Array): T[] 🔒 ES3
@daqi
daqi / filterContactInfo.js
Last active June 12, 2019 04:46
FilterContactInfo
function FilterContactInfo($str){ // 过滤手机号码、QQ号、邮箱、地址
$str = preg_replace('/(Q|Q|扣扣|企鹅|扣|联系|手机|电话|号)+[:[:punct:]一二三四五六七八九零壹贰叁肆伍陆柒捌玖\d1234567890①②③⑤]+/i', '', $str);
// 过滤网址、邮箱
$str = preg_replace('/(网址|邮箱)*[\::]*[a-z]*\@?[a-z\-]+([\.\。][a-z]+)+/i', '', $str);
return $str;
}
@daqi
daqi / gh-pages-cli.md
Created June 24, 2019 08:49
gh-pages cli help
  -V, --version            output the version number
  -d, --dist <dist>        Base directory for all source files
  -s, --src <src>          Pattern used to select which files to publish (default: "**/*")
  -b, --branch <branch>    Name of the branch you are pushing to (default: "gh-pages")
  -e, --dest <dest>        Target directory within the destination branch (relative to the root) (default: ".")
  -a, --add                Only add, and never remove existing files
  -x, --silent             Do not output the repository url
  -m, --message <message>  commit message (default: "Updates")
  -g, --tag <tag>          add tag to commit
@daqi
daqi / .yarnrc
Created February 13, 2020 08:46 — forked from wayou/.yarnrc
配置 yarn 使用国内镜像进行安装的 rc 文件,将此文件放到项目根目录使用
registry "https://registry.npm.taobao.org"
disturl "https://npm.taobao.org/dist"
nvm_nodejs_org_mirror "http://npm.taobao.org/mirrors/node"
NODEJS_ORG_MIRROR "http://npm.taobao.org/mirrors/node"
sass_binary_site "http://npm.taobao.org/mirrors/node-sass"
electron_mirror "http://npm.taobao.org/mirrors/electron/"
SQLITE3_BINARY_SITE "http://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror "http://npm.taobao.org/mirrors/node-inspector/"
node_inspector_cdnurl "https://npm.taobao.org/mirrors/node-inspector"
selenium_cdnurl "http://npm.taobao.org/mirrors/selenium"
@daqi
daqi / .npmrc
Created February 13, 2020 08:46 — forked from wayou/.npmrc
配置 npm 及相关资源访问国内镜像的 npmrc
# package-lock=false
registry="https://registry.npm.taobao.org"
disturl="https://npm.taobao.org/dist"
nvm_nodejs_org_mirror="http://npm.taobao.org/mirrors/node"
nodejs_org_mirror="http://npm.taobao.org/mirrors/node"
sass_binary_site="http://npm.taobao.org/mirrors/node-sass"
electron_mirror="http://npm.taobao.org/mirrors/electron/"
SQLITE3_BINARY_SITE="http://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror="http://npm.taobao.org/mirrors/node-inspector/"
node_inspector_cdnurl="https://npm.taobao.org/mirrors/node-inspector"