Skip to content

Instantly share code, notes, and snippets.

View hmua's full-sized avatar
❤️
blablablahblam!

Hia Hia hmua

❤️
blablablahblam!
View GitHub Profile
@hmua
hmua / 生成Jekyll文件.js
Last active July 13, 2023 15:31
B站动态自动归档
RawStorage=(()=>{
verify=(()=>{
a=Object.keys(localStorage)
prefix='archive_';console.assert(a.every(a=>a.startsWith(prefix)))
console.assert(/*isLatestOnTop*/JSON.stringify(a.toSorted().reverse())==JSON.stringify(a))
console.log('#RawStorage verified')
})()
formatFiles=async a=>{
groupBy=(x,f)=>x.reduce((a,b,i)=>((a[f(b,i,x)]||=[]).push(b),a),{})
const name=d=>`${d.getFullYear()-2000}-${d.getMonth()+1}-${d.getDate()}-.md`