Skip to content

Instantly share code, notes, and snippets.

View xiaoouwang's full-sized avatar
🎯
Focusing

Xiaoou WANG xiaoouwang

🎯
Focusing
View GitHub Profile
@xiaoouwang
xiaoouwang / extractComments.js
Created August 29, 2020 19:31 — forked from alexschreyer/extractComments.js
Extract comments from Acrobat PDF
// Get all annotations in current document
var annots = this.getAnnots();
// Assemble them into a Tab-delimited string (remove linebreaks in comments, too)
var cMyC = "Comment\tPage";
for ( var i=0; i<annots.length; i++ )
cMyC += ("\n"+annots[i].contents.replace(/(\r\n|\n|\r)/gm,"")+ "\t" + annots[i].page);
// Export them to MS Excel (opens the data there)
this.createDataObject({cName: "myCommentList.xls", cValue: cMyC});
@xiaoouwang
xiaoouwang / auto_git_file.md
Created November 12, 2018 20:12 — forked from darencard/auto_git_file.md
Automatic file git commit/push upon change

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
git config credential.helper store