Skip to content

Instantly share code, notes, and snippets.

View alanzchen's full-sized avatar
👨‍🎓
Finishing a Ph.D.

Alan Chen alanzchen

👨‍🎓
Finishing a Ph.D.
View GitHub Profile
@alanzchen
alanzchen / DevonThink to Zotero.ipynb
Last active April 30, 2024 23:14
Copying PDFs from DevonThink to their corresponding Zotero items
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / ChiMerge.ipynb
Last active April 17, 2024 17:29
ChiMerge implementation in Python 3.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / popclip-chatgpt.js
Last active March 21, 2024 15:34
PopClip Actions using ChatGPT.
// #popclip extension for ChatGPT
// name: ChatGPT Quick Actions
// icon: iconify:logos:openai-icon
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
@alanzchen
alanzchen / convert.py
Created September 1, 2021 23:03
Convert Word with Zotero citation to Markdown. Step 1: https://www.zotero.org/support/kb/moving_documents_between_word_processors Step 2: Convert the docx to Markdown via pandoc with "--wrap=none". Step 3: Use this script to process the markdown file.
#!/usr/bin/env python3
import sqlite3
import re
import json
import argparse
def convert(db, filename):
con = sqlite3.connect(db)
cur = con.cursor()
with open(filename, "r") as f:
@alanzchen
alanzchen / keynote.scpt
Created September 4, 2023 04:57 — forked from lambdamusic/keynote.scpt
Apple Keynote: export presenter notes. This version accounts for skipped slides.
-- HOWTO:
-- after saving it, open with Script Editor (default) and run it
-- PREREQUISITES:
-- make sure your Keynote presentation is open in the background
-- AFTER EXPORT:
-- if you can't open the file due to encoding errors, open with Sublime (or another a text editor) and then "File / Save with encoding / UTF8"
tell application "Keynote"
@alanzchen
alanzchen / WeChat_Pay_Bill_Export.py
Last active August 25, 2022 07:41
WeChat Pay Bill Export
# Install the Python Requests library:
# `pip install requests`
import requests
import datetime
import pickle
set_date = datetime.datetime
# Simply call get_record and it will return a json object containing your bill.
@alanzchen
alanzchen / is_papers_from_crossref.ipynb
Created March 14, 2022 04:10
Collecting Information Systems papers from MISQ, ISR, and JMIS using Crossref and download citations (papers from MISQ available after 2013 only)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / index.html
Last active March 1, 2022 04:41
The most dangerous deadline
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@alanzchen
alanzchen / anonymize_annotations.js
Created February 2, 2022 18:10
Anonymize PDF annotations in Adobe Acrobat DC Pro
this.syncAnnotScan();
var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++) {
annots[i].author = "Redacted";
}
@alanzchen
alanzchen / karabiner.json
Last active August 8, 2021 21:46
CapsLock + ijkl → Arrow Keys, CapsLock + <> → arrow with option, CapsLock + h → backspace, left/right shift → ()
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {