This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynput import mouse, keyboard | |
import time | |
from datetime import datetime | |
import os.path | |
def timestamp_ms(): | |
return int((datetime.utcnow() - datetime(1970, 1, 1)).total_seconds() * 1000) | |
FILE_NAME = os.path.expanduser(os.path.join("~", "Documents", f"records_{timestamp_ms()}.csv")) | |
MAX_TIME_SECONDS = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Put this in associationMap--> | |
<association langID="54" id="r_function"/> | |
<!--Put this in parsers--> | |
<parser id="r_function" displayName="R function" commentExpr="(#.*?$)"> | |
<function | |
mainExpr="(^\s*[a-zA-Z0-9_\.\$]+[\s<\-=]+function\s*\()" | |
displayMode="$functionName"> | |
<functionName> | |
<nameExpr expr="^\s*([a-zA-Z0-9_\.\$]+)"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(magick) | |
imagefiles <- list.files(pattern = "(\\.png|\\.jpg|\\.jpeg)") | |
imagefiles <- imagefiles[!grepl("blank-", imagefiles)] | |
for (imgname in imagefiles){ | |
img <- image_read(imgname) | |
img <- image_fill(img, "lightgray", fuzz = 100) | |
img <- image_annotate(img, imgname) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inclpdf <- function(fronts, backs, npages, reverse = FALSE){ | |
if (reverse){ | |
for (i in 1:npages){ | |
cat("\\includepdf[pages=", i, "]{", fronts, "}\n", | |
"\\includepdf[pages=", npages - i + 1, "]{", backs, "}\n", | |
sep = "") | |
} | |
} else { | |
for (i in 1:npages){ | |
cat("\\includepdf[pages=", i, "]{", fronts, "}\n", |