Skip to content

Instantly share code, notes, and snippets.

View mgao6767's full-sized avatar
๐Ÿ˜€

Adrian Gao mgao6767

๐Ÿ˜€
View GitHub Profile
@pchemguy
pchemguy / Zotero_MainDB.md
Last active October 24, 2025 23:20
Exploring Zotero Data Model for Direct Database Access

Exploring Zotero Data Model for Direct Database Access

This tutorial aims to provide technical information necessary for direct access to data stored in Zotero's local bibliographic database. The official documentation [mentions][Zotero Client Data Model] the present topic briefly, so I decided to post a more detailed discussion.

Zotero's local bibliographic database is an [SQLite][] database, the leading open-source relational database management system (RDBMS). Hence, direct access to this data necessitates basic familiarity with [relational databases][RDBMS] and [SQL][] (free SQL resources are readily available on the Internet, including the [official documentation][SQLite docs] focused on the SQLite SQL dialect and [this tutorial][SQLite SQL Tutorial]).

Table of Contents

@alexeyknorre
alexeyknorre / stargazer_fix.r
Created May 31, 2022 04:50
Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
## Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
# Unload stargazer if loaded
detach("package:stargazer",unload=T)
# Delete it
remove.packages("stargazer")
# Download the source
download.file("https://cran.r-project.org/src/contrib/stargazer_5.2.3.tar.gz", destfile = "stargazer_5.2.3.tar.gz")
# Unpack
untar("stargazer_5.2.3.tar.gz")
# Read the sourcefile with .inside.bracket fun
@JoostImpink
JoostImpink / earnings_management_models.sas
Last active March 30, 2024 04:49
Estimate earnings management models
/*
Earnings management models
Author: Joost Impink, March 2016
Models estimated:
- Jones model, tac = a0 + a1 1/TAt-1 + a2chSales + a3PPE + a4ROA + error.
- variable names DA_Jones ABSDA_Jones
- Modified Jones model, as Jones model, but using chSales - chREC to compute fitted values.