Skip to content

Instantly share code, notes, and snippets.

View heroicyang's full-sized avatar
🎯
Focusing

Heroic Yang heroicyang

🎯
Focusing
View GitHub Profile
@heroicyang
heroicyang / duoshuo_style.css
Last active May 15, 2020 09:06
Custom style for DuoShuo comment plugin in Hexo modernist theme
.ds-meta,
#ds-thread #ds-reset .ds-powered-by {
display: none;
}
#ds-thread #ds-reset .ds-sort a.ds-current,
#ds-thread #ds-reset .ds-sort a:active,
#ds-reset .ds-highlight,
#ds-thread #ds-reset .ds-login-buttons .ds-more-services {
color: #069 !important;
@heroicyang
heroicyang / array uniq
Created May 17, 2013 12:15
数组去重(uniq)
function uniq (arr1, arr2) {
var result = arr1.concat(arr2)
, len = result.length;
for (var i = 0; i < len; i++) {
var firstIdx = result.indexOf(result[i])
, lastIdx = result.lastIndexOf(result[i]);
while (firstIdx !== lastIdx) {
result.splice(lastIdx, 1);
len = len - 1;
@heroicyang
heroicyang / gist:5161470
Created March 14, 2013 13:51
树遍历操作
var id = 1;
(function loop (children) {
var nextChildren = [];
_.map(children, function (child) {
child.uid = child.name + '-' + id;
if (child.children && child.children.length > 0) {
nextChildren = nextChildren.concat(child.children);
}
id += 1;
});