Skip to content

Instantly share code, notes, and snippets.

View alanzchen's full-sized avatar

Alan Chen alanzchen

View GitHub Profile
@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 / popclip-chatgpt.js
Last active September 13, 2024 18:50
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 / 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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / DevonThink to Zotero.ipynb
Last active April 30, 2024 23:14
Copying PDFs from DevonThink to their corresponding Zotero items
Loading
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 / 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 / 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": {
@alanzchen
alanzchen / biased coin python.ipynb
Created July 8, 2021 03:40
Biased Coin implementation in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- Convert Markdown documents to Pandoc PDFs (using XeTeX)
-- Created by Christian Grunenberg on Mon Dec 01 2008.
-- Copyright (c) 2008-2011. All rights reserved.
-- Slightly changed by Silverstone on March 18 2019,
-- All copyrights go to great DEVONtech Team ;)
-- Repurposed by Alan Chen on May 27 2021
tell application id "DNtp"
try
set theSelection to the selection