This file contains 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 trans(s) { | |
var l = s.length % 3 || 3; | |
return s.slice(0,l)+s.slice(l).replace(/(\d{3})/g, ",$1"); | |
} |
This file contains 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 trans(s) { | |
s = s.replace(/-(\d)0/g, "-$1"); | |
var d = ["〇", "一", "二", "三", "四", "五", "六", "七", "八", "九", "", "十", "二十", "三十", "年", "月"]; | |
var r = [], flag = 14, gap = 0, t; | |
for(var i = 0; i < s.length; i ++) { | |
t = s.charAt(i); | |
if(t === "-") { | |
r.push(d[flag++]); | |
gap = 10; | |
} else { |
This file contains 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 qsort(a, p, r) { | |
if(p < r) { | |
var q = partition(a, p, r); | |
qsort(a, p, q - 1); | |
qsort(a, q + 1, r); | |
} | |
} | |
function partition(a, p, r) { | |
var mid = a[r]; |
This file contains 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 reverse(s, k) { | |
var arr = s.split(""), l = s.length; k = k % l; | |
function r(m, n) { | |
while(m < n) { | |
var tmp = arr[m]; | |
arr[m++] = arr[n]; | |
arr[n--] = tmp; | |
} | |
} | |
r(0, k - 1); |
This file contains 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 cal(node, cur) { | |
cur = cur || 1; | |
var c = node.childNodes; | |
if(node.nodeName === "IFRAME") { | |
c = [node.contentDocument]; | |
} | |
var i = 0, l = c.length, maxarr=[]; | |
if(c && l) { | |
cur ++; | |
while(i < l) { |
This file contains 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
echo 'start building!' | |
echo $PATH | |
export PATH=$PATH:/usr/local/bin | |
echo $PATH | |
pwd | |
cd use-php | |
/usr/local/bin/npm install | |
/usr/local/bin/fis3 release -d ../../builds/$BUILD_NUMBER/use-php | |
tar -czf ../../builds/$BUILD_NUMBER/$BUILD_TAG.tar.gz -C ../../builds/$BUILD_NUMBER/use-php . | |
echo 'build success!' |
This file contains 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
a=$('.subitems').map(function() { | |
return $(this).find('dl').map(function() { | |
var res = {}, $this = $(this); | |
var name = $this.children('dt').text().slice(0, -1); | |
res[name] = $this.children('dd').children('a').map(function() { return $(this).text(); }).get(); | |
return res; | |
}).get(); | |
}).get(); |
This file contains 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
//重写UploadFile和xhrUploadImg | |
function changeGlobalUploadFilePrototype() { | |
if (!window.FileReader || !window.FormData) { | |
// 如果不支持html5的文档操作,直接返回 | |
return; | |
} | |
var E = wangEditor; | |
wangEditor.UploadFile.fn.selected = function(e, input) { |
This file contains 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
//content scripts 与页面通信 | |
var port = chrome.runtime.connect(); | |
window.addEventListener("message", function(event) { | |
// We only accept messages from ourselves | |
if (event.source != window) | |
return; | |
if (event.data.type && (event.data.type == "FROM_PAGE")) { | |
console.log("Content script received: " + event.data.text); |
This file contains 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
var ms = new SpeechSynthesisUtterance("ある程度の人数を集めなければいけなかったので、実父の趣味で「祭り」の仲間に大勢来てもらう事が出来ました。そのおかげで、友人は居ませんでしたが、和太鼓の演舞や新郎を簡易のお神輿に乗せて練り歩く等の余興をしてもらう事ができて、とても賑やかな式になりました。 (40歳/女性)"); | |
msg.lang = 'ja-JP'; | |
msg.rate = 0.8; | |
var list = speechSynthesis.getVoices(); | |
var newlist = list.filter(l => l.lang.indexOf('ja') >= 0) | |
console.log(newlist) | |
msg.voice = newlist[0] | |
window.speechSynthesis.speak(msg); | |
OlderNewer