Skip to content

Instantly share code, notes, and snippets.

View geektutu's full-sized avatar
🎯
Focusing

Dai Jie geektutu

🎯
Focusing
View GitHub Profile
@geektutu
geektutu / Gitalk-plus-comment.js
Last active December 28, 2022 13:51
模仿disqus的 SEE ALSO ON <blog> 功能,为静态博客添加“显示本站其他文章评论”的功能。 https://geektutu.com/post/blog-experience-7.html
/**
* Generate Comments JSON Data
*/
const https = require('https');
const fs = require('fs');
const github = {
client_id: '<your-client-id>',
client_secret: '<your-client-secret>',
repo: '<your-github-repo>',
@hutusi
hutusi / git paging.md
Last active January 1, 2024 15:56
Git checkout next / prev commit

Treat git log as a book, exec git next or git prev to checkout the next or the previous commit.

Please check hutusi/git-paging for updates.

# Sort a list of dictionary objects by a key - case sensitive
from operator import itemgetter
mylist = sorted(mylist, key=itemgetter('name'))
# Sort a list of dictionary objects by a key - case insensitive
mylist = sorted(mylist, key=lambda k: k['name'].lower())