世上无难事只怕你硬来 – 索尼子 https://bakasoniji.com 笨蛋索尼子的博客 Mon, 10 Jun 2019 07:51:48 +0000 zh-CN hourly 1 https://wordpress.org/?v=4.9.5 JavaScript 解 Word Scramble https://bakasoniji.com/2019/06/10/javascript-%e8%a7%a3-word-scramble.html https://bakasoniji.com/2019/06/10/javascript-%e8%a7%a3-word-scramble.html#comments Mon, 10 Jun 2019 07:25:12 +0000 http://soniji.mist.so/?p=272 词汇量不够,还蠢,于是就写了个JavaScript来解WordScramble了. .
需要jQuery才能运行. .

var wordList = $.getJSON('https://raw.githubusercontent.com/words/an-array-of-english-words/master/words.json');
var letters = 'yotbanl'; // 提供的字母
wordList.responseJSON.filter(function(word) {
    return word.length == letters.length;
}).filter(function(word) {
    for (var c of letters) {
        if (!word.includes(c)) {
            return false;
        }
    }
    return true;
});

[“notably”]

于是从提供的字母yotbanl里找到了对应的unscrambled单词notably. .

词库来自:https://github.com/words/an-array-of-english-words

]]>
https://bakasoniji.com/2019/06/10/javascript-%e8%a7%a3-word-scramble.html/feed 1
WHMCS中如何隐藏已删除及已取消产品 https://bakasoniji.com/2017/02/05/whmcs%e4%b8%ad%e5%a6%82%e4%bd%95%e9%9a%90%e8%97%8f%e5%b7%b2%e5%88%a0%e9%99%a4.html https://bakasoniji.com/2017/02/05/whmcs%e4%b8%ad%e5%a6%82%e4%bd%95%e9%9a%90%e8%97%8f%e5%b7%b2%e5%88%a0%e9%99%a4.html#respond Sun, 05 Feb 2017 18:52:02 +0000 http://sonic1997.urpgs.com/?p=258 在WHMCS的模板目录里打开clientareaproducts.tpl

寻找类似以下的内容


	{$service.product}{if $service.domain}
{$service.domain}{/if} {$service.amount}
{$service.billingcycle} {$service.nextduedate} {$service.statustext} {$LANG.manageproduct}

然后用
{if $service.rawstatus ne "terminated" && $service.rawstatus ne "cancelled"}和{/if}将上面的那段代码包起来即可(

于是看起来将是这样的

{if $service.rawstatus ne "terminated" && $service.rawstatus ne "cancelled"}
	
		{$service.product}{if $service.domain}
{$service.domain}{/if} {$service.amount}
{$service.billingcycle} {$service.nextduedate} {$service.statustext} {$LANG.manageproduct} {/if}

这个解决方案不是利用产品列表里的那个filter的,而是完全不让这些被删除了的和被取消了的产品显示在列表上;因此即使点击filter来尝试显示已删除和已取消的产品也是不会显示出来的了(

]]>
https://bakasoniji.com/2017/02/05/whmcs%e4%b8%ad%e5%a6%82%e4%bd%95%e9%9a%90%e8%97%8f%e5%b7%b2%e5%88%a0%e9%99%a4.html/feed 0