I hereby claim:
- I am ccbikai on github.
- I am ccbikai (https://keybase.io/ccbikai) on keybase.
- I have a public key ASAayS5EUfE0yo6rmHR6YP6Q-eKmzFZlu8R0s3rW0TQ-NQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| [1,2,3].reduce(function(sequence, i) { | |
| return sequence.then(function() { | |
| return Promise.resolve(i); | |
| }).then(function(j) { | |
| console.log(j); | |
| }); | |
| }, Promise.resolve()); | |
| // 从一个完成状态的 Promise 开始 | |
| var sequence = Promise.resolve(); |
| (function(doc, win) { | |
| var docEl = doc.documentElement, | |
| resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | |
| recalc = function() { | |
| var clientWidth = docEl.clientWidth; | |
| if (!clientWidth) { | |
| return | |
| }; | |
| if (clientWidth >= 640) { |
| function getMatchingBra(code) { | |
| var stack = []; | |
| var bra = []; | |
| for(var i = 0; i < code.length; i++) bra.push(-1); | |
| for(var i = 0; i < code.length; i++) { | |
| if(code[i] === '[') { | |
| stack.push(i); | |
| } else if(code[i] === ']') { | |
| bra[i] = stack.pop(); | |
| bra[bra[i]] = i; |
| var defaultEncoding = 1; // 預設語言:1-繁體中文 | 2-简体中文 | |
| var translateDelay = 0; | |
| var cookieDomain = window.location.protocol + "//" + window.location.host; | |
| var msgToTraditionalChinese = "轉換爲繁體"; | |
| var msgToSimplifiedChinese = "转换为简体"; | |
| var translateButtonId = "translateLink"; | |
| var currentEncoding = defaultEncoding; | |
| var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g,""); | |
| var targetEncoding = ( getCookie(targetEncodingCookie) == null ? defaultEncoding : getCookie(targetEncodingCookie) ); |
| # -*- coding: utf-8 -*- | |
| import sys | |
| reload(sys) | |
| sys.setdefaultencoding('utf-8') | |
| # unsplash 全站下载脚本 | |
| # 请先安装 requests ,BeautifulSoup | |
| # pip install requests beautifulsoup4 | |
| # 运行 python unsplash.py | |
| # 输入最小页数和最大页数 |
| function wp_iframe_handler_m163( $matches, $attr, $url, $rawattr ) { | |
| $iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/m163player/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>'; | |
| return apply_filters( 'iframe_m163', $iframe, $matches, $attr, $url, $rawattr ); | |
| } | |
| wp_embed_register_handler( 'm163_iframe', '#http://music.163.com/\#/song\?id=([\d]+)(.*?)#i', 'wp_iframe_handler_m163' ); |
| SongUrl = (function (sLocation) { | |
| var num = Number(sLocation.charAt(0)), | |
| inp = sLocation.substr(1), | |
| iLe = inp.length % num, | |
| a = 0, | |
| ret = '', | |
| arr = []; | |
| for (var i = 0; i < num; i++) { | |
| arr[i] = (iLe > i ? 1 : 0) + (inp.length - iLe) / num; | |
| } |
| function wp_iframe_handler_xiami( $matches, $attr, $url, $rawattr ) { | |
| $iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/xiamiplayer/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>'; | |
| return apply_filters( 'iframe_xiami', $iframe, $matches, $attr, $url, $rawattr ); | |
| } | |
| wp_embed_register_handler( 'xiami_iframe', '#http://www.xiami.com/song/([\d]+)(.*?)#i', 'wp_iframe_handler_xiami' ); |
| function wp_iframe_handler_gist( $matches, $attr, $url, $rawattr ) { | |
| $iframe = '<iframe width="100%" height="300" src="https://gist.github.com/'. esc_attr($matches[1]) .'/'. esc_attr($matches[2]) . '.pibb" frameborder=0 ></iframe>'; | |
| return apply_filters( 'iframe_gist', $iframe, $matches, $attr, $url, $rawattr ); | |
| } | |
| wp_embed_register_handler( 'gist_iframe', '#https://gist.github.com/(.*?)/([\w]+)#i', 'wp_iframe_handler_gist' ) |