This file contains hidden or 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
import os | |
import FileUtil,TimeUtil | |
# hulu导出数据/2022-04-01.md -> journals/2022_04_01.md,没办法,为了兼容Logseq的日志格式 | |
def renameFileByDate(path): | |
name =FileUtil.getFileName(path) | |
srcDir = FileUtil.getFileDir(path) | |
ext =FileUtil.getFileExt(path) | |
if "-" in name: | |
destName = TimeUtil.converDataFormat(name) |
This file contains hidden or 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
import time | |
from datetime import datetime | |
# 格式化成2016-03-20 11:45:39形式 | |
# print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) ) | |
# 格式化成Sat Mar 28 22:24:24 2016形式 | |
# print(time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()) ) | |
This file contains hidden or 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
import os | |
from datetime import datetime | |
import json | |
path="C:/Users/Administrator/Dropbox/MyGithub/MyPython/src/FileUtil.py" | |
# 打印文件路径 | |
def printPath(path): | |
print(path) | |
print(os.path.dirname(path), ".dir") |
This file contains hidden or 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
import os | |
import FileUtil,TimeUtil | |
# hulu/2022-04-01.md -> journals/2022_04_01.md,没办法,为了兼容Logseq的日志格式 | |
def renameFileByDate(path): | |
name =FileUtil.getFileName(path) | |
srcDir = FileUtil.getFileDir(path) | |
ext =FileUtil.getFileExt(path) | |
if "-" in name: | |
destName = TimeUtil.converDataFormat(name) |
This file contains hidden or 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
{ | |
"name": "my-blog", | |
"private": true, | |
"scripts": { | |
"dev": "next dev", | |
"build": "next build", | |
"start": "next start", | |
"lint": "next lint" | |
}, | |
"dependencies": { |
This file contains hidden or 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
from datetime import datetime | |
import os | |
from this import d | |
def converDataFormat(text): # 日期格式转换 2012-09-20 -> 2012_09_20 | |
srcTime = datetime.strptime(text, '%Y-%m-%d') | |
destTime = srcTime.strftime("%Y_%m_%d") | |
return destTime | |
This file contains hidden or 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
[{ | |
"name": "study-nextjs-blog", | |
"rootPath": "c:\\Users\\Administrator\\Dropbox\\MyGithub\\study-nextjs-blog", | |
"paths": [], | |
"tags": [], | |
"enabled": true | |
}, | |
{ | |
"name": "MyLogseq", | |
"rootPath": "C:\\Users\\Administrator\\Dropbox\\MyObsidian\\MyLogseq", |
This file contains hidden or 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
/* 全局属性 | |
* 页边距 padding: 30px; | |
* 全文字体 font-family: ptima-Regular; | |
* 英文换行 word-break: break-all; | |
*/ | |
#nice { | |
} | |
/* 段落,下方未标注标签参数均同此处 | |
* 上边距 margin-top: 5px; | |
* 下边距 margin-bottom: 5px; |
This file contains hidden or 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
import type { NextPage } from 'next'; | |
const Home: NextPage = () => { | |
return <div>我是首页</div>; | |
}; | |
export default Home; |
This file contains hidden or 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
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | |
var Mock = require('mockjs') | |
var Random = Mock.Random | |
var data = Mock.mock({ | |
// 属性 list 的值是一个数组,其中含有 1 到 20 个元素 | |
'list|1-20': [{ | |
// 属性 id 是一个自增数,起始值为 1,每次增 1 | |
'id|+1': 1, | |
// 随机生成一个布尔值,值为 value 的概率是 min / (min + max),值为 !value 的概率是 max / (min + max)。 | |
'star|1-9': true, |