Skip to content

Instantly share code, notes, and snippets.

@anamewing
anamewing / git-log2json.sh
Created January 19, 2018 13:01
git export log to json
#!/usr/bin/env bash
git log \
--date=local \
--tags \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%cd",%n "message": "%f",%n "parentSha": "%P"},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@anamewing
anamewing / git-tag2json.sh
Created January 19, 2018 13:00
git export ref to json
#!/usr/bin/env bash
git for-each-ref \
--format='{"tag":"%(refname:short)" ,%0a "date":"%(taggerdate)" },' \
refs/tags \
$@ | \
perl -pe 'chomp if eof;BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@anamewing
anamewing / cleveref-chinese.tex
Last active March 23, 2024 17:03
Add Simplified Chinese translation to cleveref.
\crefname{equation}{式}{式}
\crefname{figure}{图}{图}
\crefname{table}{表}{表}
\crefname{page}{页}{页}
\crefname{chapter}{章}{章}
\crefname{section}{节}{节}
\crefname{appendix}{附录}{附录}
\crefname{theorem}{定理}{定理}
\crefname{lemma}{引理}{引理}
\crefname{corollary}{推论}{推论}
@anamewing
anamewing / pawoo_showMedia.user.js
Last active April 17, 2017 16:25
show the hidden media in Pawoo by default
// ==UserScript==
// @name pawoo_showMedia
// @namespace mewing
// @include https://pawoo.net/*
// @version 1
// @grant none
// ==/UserScript==
// Thanks to pawoo.netの画像全部表示するやつ by tasogare
// https://chrome.google.com/webstore/detail/hhfebcpaahgegnabkmhohnfochmbjjfd
@anamewing
anamewing / asmems4.bst
Last active December 18, 2016 10:46
A modification on DOI support of ASME LaTeX template bibliographic style file asmems4.bst
% ASME Transactions bibliography style (25-Aug-03 version)
% Adapted from parts of unsrt, acm, and apalike, but:
% Author names come out "Last, initials" as in acm and apalike;
% Author name(s) are in \rm like apalike, not \sc as in acm;
% Year follows name(s) of author(s) as in apalike, but not inside parentheses;
% Periodical volume number is in \bf;
% Periodical number is inside parentheses as in unsrt;
% Pages use pp as in acm.
%
% History